Hello there, i did type it wrong, but when I compared your line with the line that is in yellow, they appear to be the same. and I am still getting that error.
Am I doing something wrong?
Hello there, i did type it wrong, but when I compared your line with the line that is in yellow, they appear to be the same. and I am still getting that error.
Am I doing something wrong?
Hello pboost1,
Try changing the declarations at the very top of the macro module. The code runs fine on my machine. Any variable declared in the General Declarations section of VBA module should be available to the entire VBA project. I used a Dim statement. So, to force it to be available to the project, change the Dim statements to public.
Code Currently
Code Change![]()
'Statements Before Change Dim xlApp As Object Dim xlWkb As Object
Sincerely,![]()
'Statements After Change Public xlApp As Object Public xlWkb As Object
Leith Ross
I think i found out what I was doing wrong. i was opening the word document first, then excel. I tied opening excel and then word and that seems to work.
I now have to figure out how to copy this for what I have at work. I have about 800 forms that I will need to have this work for.
Again my programming skills are not the greatest. I will have to look at what you have and hopefully be able to copy it over.
If I may ask one question, I see you are using the drop down box, which makes things easier than retyping the data, is there a way to have it auto fill without using the drop down box? If not, I thank you enough for all that you have done.
Hello pboost1,
I didn't change the drop down boxes as they were part of the original form you sent me. It seemed more logical to have a single drop down for the Form Numbers and auto-fill the remaining sections. The other fields can be changed to auto-filled, but that means I will need to alter the macro as well. If that is what you want to do, I will need some time to make those changes. Let me know.
Sincerely,
Leith Ross
Yes, please. I would like to be able to enter the one data form number and have everything else autofill. If that could be done, that would be great. Thanks.
Hello pboost1,
The attached Word document has been amended. It will now auto-fill the text on the template when you select a form number.
Sincerely,
Leith Ross
The sample works great. I thank you very much. I just need to adapt what you have given to what I have at work. Thank you again.
Would you be willing to explain how you did this? If you don't want to or feel comfortable, I definitely understand. You have helped out a lot with all that you have done. Thank you again.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks