I concur that. I've just learned how to VBA. And if I may speak the truth for a minute: He has a very, very light Indian accent, which makes his instructions so much easier to understand than most of whom I've come across. It's an honest statement. NO OFFENSE.
time table : @6:53 the finished layout of the excel that will import the data from word @7:27 linking word doc for input and excel sheet for output @8:32 the coding of the vba
Hi! Do you have any videos on how to create a customize ribbon on Visual Studio for PowerPoint Add-in where I can put different square colors where I click the square color and make it change a shape with that color? Same with a border color and text color?
Thank you for this! I have successful written the codes to execute my form using the control form button as you illustrated. Then, I also included a clear form macro to clear the contents, so that users could run the exportToWord macro repeatedly using different information. However, I cannot get the exportToWord macro to run again without completely closing out of the excel file and then re-opening. Is there any way to get around this? Some type of loop or call command? Or is there something I need to force closed to be able to do this?
He used auto instancing in Dim WordApp as New Word.Application So your clear contents command did not work. Solution: Declare the WordApp like this Dim WordApp as Word.Application Then write this code before WordApp.Visible =True Set WordApp = New Word.Application I hope this helps. I'm on my phone rn so I cannot test it myself.
Does this work throughout a document? For instance if you have “contract date” in multiple places throughout the document, would it populate all of those fields?
Thank you for this video...all worked perfectly with what I wanted to do with the text portions of my "automated report". But now I have to also automate copying and pasting charts from Excel into specific locations on the same word document. Is this something that can be done with VBA?
Is there a way to add a bullet list of items in a word doc from excel cells? The bookmarks idea would work if the list was always of the same number of items, but what if the number of items changes?
I'm working on a word form, when filling out, there's already info known and sometime need to input a new info. example, a name and address. i can make a combo box of the ff names and also if not in the selection can type one. then the name is link to another item like address that when one name is selected the address auto-populate on the address item. this is to avoid continuous mistake for someone filing up a form. and also if the name is not on the selection, a a new name can be added and write the address. your help would really be halpful. Thanks!
I created this document minus the export to PDF. When running the macro the word file is opening as read only and will not update. I’m uncertain how to change the set doc = WordApp.Documents.Open([WordPath].text, , True) I’m also getting a VBA 400 error Thank you!
Hello, is it possible for doing the reverse process, that is to export/to link the data from word to excel? the word doc is as same as your lease agreement's sample, thankyou
hello i have an error of 5914 my word document is showing me up with read only format only i have used all posibilities to remove protection sheet but still my document is opening in read only format
Dear VBA.A2Z. you have done a great job, can you make it like to save every letter saves into same document using EXCEL ?????????? Thank you So much for you knowlede sharing.
Thank you so much for sharing your knowledge. Really appreciate it. Do you have any mobile application coming from Excel. Looking forward for this tutorial. God bless.
@@VBAA2Z yeah I already subscribe to your awesome channel. Is it possible to have a mobile application that is connected to Ms Excel? Looking forward to that. 😊
thanks for nice explanation/ i have a question pleas / if i need to add a command botton inside the word document or templat and write a code for it that save the document as the NAME lable field (plain text content control), in a specific bath directory, how can i write the code pleas ? can you drope the line code that do this when i click in this command botton.? pleas your answe and thank you in advance.
I have Problem In doc.ExportAsFixedFormat After imputing ".pdf" in last of That Line. The Flash Window message to Debug Is Not showing and Also Not Creating The File In The Export Output Folder... Reference - 10:30 to 11:10 From Vedio
try with static path and see if it works if good with below, it is possible your docpath variable is not returning qualified full path doc.ExportAsFixedFormat "C:\test.pdf"
Hi ! I'm having an issue with an error saying 'Run-time error 6124 : You are not allowed to edit this selection because it is protected'. This occurs for the tenant.Text = Range("tenant").Value code. previously this code work properly on office 2019 but error on office 2016
When you go to the Developer tab, and click the "Restrict Editing" button it'll to show task pane with protection in current document. Else it is possible you're writing to uneditable region (like the end or beginning of a row).
@@VBAA2Z Thanks for your feedback. I've follow your suggestion and checked on restrict editing, but on formating restriction and editing restriction already on unchecked position. And If else any issue on uneditable region, this code should be error on office 2019 also right?
Hi, excellent video How can I do if I have several times that I have to enter the same data, in order not to enter different markers for the same text, I tried to use cross reference but it has not worked
If you want to write to same range multiple times without closing the file first get the bookmark range address and keep reusing it by creating bookmarks on runtime. hope it helps.
Hi! When I run the code it prompted that "Run-time error '6124' You are not allowed to edit this selection because it is protected". For the set rng_cdate it runs smoothly, but for the tenant.Text=Range("Tenant").Value and landlord.Text=Range("Landlord").Value it failed. Could u please suggest how can I fix the error?
hi sir this is really help full for me thanks for this tutorial but i have one question is their any possibility of automation between Word and publisher
@@VBAA2Z sir plz make one video on publisher and word automation like if we add any text or image(chart) in publisher its will automatically add in word document
Great Tutorial - thank you No matter what I do with the date I cannot get it to copy to the Word Document in the same format My spreadsheet displays as 22 January 2021 but when you view the Word Document it displays as 22/01/2021 Please help
Hi! Thank you for this tutorial. I am a begginer in VBA. I followed your code. When I run it, I get User-defined type not defined with reference to Sub ExportToWord (). Could you give me a hint what can be wrong? Additionally, I was trying to look for this material to download on your website, but unfortunately it looks missing. Could you refer where I can find it?
How to transfer data including tables and paragraphs in different worksheets (having user form containing check boxes, selection button, list etc to choose from) into a single word document at a particular location only under different clauses using vba. For example word document first page is cover sheet having project name client name date , 2nd page is index sheet with clause number and page reference. 3rd page starts with clause 1.0 as introduction. 2 scope of supply and so on. It should take data from excel and paste at particular locations on click of button
Check this 2 videos. It'll give you google ides to work with Word Objects and also with word table. ua-cam.com/video/KoTuy92uboY/v-deo.html ua-cam.com/video/RQgOxv6nrE0/v-deo.html Create a dummy table in template word file and write to it. All the best!
Hi ! I'm having an issue with an error saying 'Compile error : Argument not optional'. This occurs for the doc.ExportAsFixedFormat code. Could you please help me with this ?? Thank you.
@@VBAA2Z yes.. i have to prepare a manual letter in word file, where i need to update the information for particular person, like name ,address, amount at a specific position. i want coding for this.
Hi, I have 1000 pages in word document In that 1st page has two highlighted word in two different places And I want to highlight rest 999 page at exact the same location ... Can you please share the VBA code for that
The instruction is all over the place as though you forget maybe new people are trying to follow along. You already had windows opened and didn't explain where they came from and why 😑
Your channel is gem for VBA enthusiasts
wow, thanks!
Your channel is gem for vba enthusiasts
I concur that. I've just learned how to VBA. And if I may speak the truth for a minute: He has a very, very light Indian accent, which makes his instructions so much easier to understand than most of whom I've come across. It's an honest statement. NO OFFENSE.
by far the best and most practical word automation tut. thank you, my friend.
Glad it helped
I have followed Your instructions, all works perfectly. Great Thanks
Great to hear!
Really appreciate your knowledge sharing. I have personally learned a lot from your channel. Keep it going. Many thanks!
My pleasure!
Your tutorials are too the point and very practical, thank you
You're welcome!
time table :
@6:53 the finished layout of the excel that will import the data from word
@7:27 linking word doc for input and excel sheet for output
@8:32 the coding of the vba
Thanks George!
Hi! Do you have any videos on how to create a customize ribbon on Visual Studio for PowerPoint Add-in where I can put different square colors where I click the square color and make it change a shape with that color? Same with a border color and text color?
thank you. Very informative and easy to follow. Keep up good work
Thanks, will do!
Thank you for this! I have successful written the codes to execute my form using the control form button as you illustrated. Then, I also included a clear form macro to clear the contents, so that users could run the exportToWord macro repeatedly using different information. However, I cannot get the exportToWord macro to run again without completely closing out of the excel file and then re-opening. Is there any way to get around this? Some type of loop or call command? Or is there something I need to force closed to be able to do this?
He used auto instancing in Dim WordApp as New Word.Application
So your clear contents command did not work.
Solution:
Declare the WordApp like this
Dim WordApp as Word.Application
Then write this code before WordApp.Visible =True
Set WordApp = New Word.Application
I hope this helps. I'm on my phone rn so I cannot test it myself.
Thanks and keep up the great work !
Thanks, will do!
great work as always. Learned alot from you sir
I appreciate that!
Does this work throughout a document? For instance if you have “contract date” in multiple places throughout the document, would it populate all of those fields?
you'll need to design the conditions so it appears where it is needed. VBA is flexible
Thank you for creating such an amazing content. I really appreciate your works. Understood many things after watching repeatedly.😀
Happy to hear that! Thanks for watching!
Hi, thank you so much for the video. I am a beginner and I learned so much from your channel
great explanation! defenitely worth my time
Great to hear!
Thank you for this video...all worked perfectly with what I wanted to do with the text portions of my "automated report". But now I have to also automate copying and pasting charts from Excel into specific locations on the same word document. Is this something that can be done with VBA?
You're welcome!
May be try something like this ua-cam.com/video/dIqoXYy_Clg/v-deo.html
The video was really useful. Thank you
you're most welcome!
Excellent and professional. thank you
You are welcome!
Thank you. Learned a lot from this video. VBA is very powerful programming language for automation.
you're welcome. glad to hear that!
question if i have rows of different person - i can also loop the record, right?
Is there a way to add a bullet list of items in a word doc from excel cells? The bookmarks idea would work if the list was always of the same number of items, but what if the number of items changes?
Best to record and edit accordingly
Leaning many things from you sir. thanks alot.
So nice of you
Another amazing content! super thanks!
Glad you like them!
Very useful. How to browse a folder or file via Excel VBA, copy the name and paste it in a specified word file??
Watch the video: ua-cam.com/video/eHuETf6ygto/v-deo.html
I'm working on a word form, when filling out, there's already info known and sometime need to input a new info. example, a name and address. i can make a combo box of the ff names and also if not in the selection can type one. then the name is link to another item like address that when one name is selected the address auto-populate on the address item. this is to avoid continuous mistake for someone filing up a form. and also if the name is not on the selection, a a new name can be added and write the address. your help would really be halpful. Thanks!
Brilliant tutorial. Many thanks
Glad it was helpful!
Is adding bookmarks mandatory to import the excel fields ? Can it be done without adding bookmarks also ?
you can add to range as below
Set myRange = ActiveDocument.Range(Start:=0, End:=10)
this is brilliant! many thanks
You're very welcome!
thanks all your tutorials are great
You are welcome!
Hi, great tutorial! Can this be done using visual studio instead? Thanks.
Yes, absolutely
please check here ua-cam.com/video/KPSuvRSwgh4/v-deo.html
@@VBAA2Z thank you so much 👍
Great tutorials.thank you soo much
You're very welcome!
I created this document minus the export to PDF. When running the macro the word file is opening as read only and will not update. I’m uncertain how to change the set doc = WordApp.Documents.Open([WordPath].text, , True)
I’m also getting a VBA 400 error
Thank you!
try and google this error. This is something to do with your office installation and not the code.
Same problem
How can I find a text in header of a doc and return page number using VBA ?
try something like this
'wRange.Find here
If wRange.Find.Execute = True Then x = wRange.Information(wdActiveEndPageNumber)
Does it require the word document be opened?
no it is not
Thanks so much I have learnt a lot.
You are very welcome
Hi Pamai, Do you know how to select non-contiguous cells in Word table with VBA?
How can we add ribbon tabs and user defined groups into that tabs for the application, Is there any reference video available for this??
Yes you can please check below link
ua-cam.com/video/ypI2VXYaXQI/v-deo.html
Hello, is it possible for doing the reverse process, that is to export/to link the data from word to excel? the word doc is as same as your lease agreement's sample, thankyou
Yes you can. Add reference to Excel Excel Object Library from Word
@@VBAA2Z thanks. How if I wanna link data from word to another word file? Maybe I missed your tutorial about this, thanks again
hello i have an error of 5914 my word document is showing me up with read only format only i have used all posibilities to remove protection sheet but still my document is opening in read only format
can you share your code?
Dear VBA.A2Z.
you have done a great job, can you make it like to save every letter saves into same document using EXCEL ??????????
Thank you So much for you knowlede sharing.
You're most welcome. Will share more examples thank you
Absolutely brilliant
thanks!
Thank you so much for sharing your knowledge. Really appreciate it. Do you have any mobile application coming from Excel. Looking forward for this tutorial. God bless.
Thanks for your note, I am going to cover JS & Office mobile apps integration soon.
Do not forget to subscribe for upcoming videos.
@@VBAA2Z yeah I already subscribe to your awesome channel. Is it possible to have a mobile application that is connected to Ms Excel? Looking forward to that. 😊
thanks for nice explanation/ i have a question pleas / if i need to add a command botton inside the word document or templat and write a code for it that save the document as the NAME lable field (plain text content control), in a specific bath directory, how can i write the code pleas ? can you drope the line code that do this when i click in this command botton.? pleas your answe and thank you in advance.
I have Problem In doc.ExportAsFixedFormat
After imputing ".pdf" in last of That Line. The Flash Window message to Debug Is Not showing and Also Not Creating The File In The Export Output Folder...
Reference - 10:30 to 11:10 From Vedio
try with static path and see if it works if good with below, it is possible your docpath variable is not returning qualified full path
doc.ExportAsFixedFormat "C:\test.pdf"
@@VBAA2Z Now its Showing Compile Error
Argument Not Optional
By selecting (.Exportasfixedformat)
did you add wdExportFormatPDF?
doc.ExportAsFixedFormat "C:\test.pdf",wdExportFormatPDF
Very useful 👍🏻 thanks for the video
Glad it was helpful!
Can we send data from one excel to multiple word documents? Like, if we want same data on different word documents but on different fields.
yes create multiple doc objects and replicate referring and write data there
Hi !
I'm having an issue with an error saying 'Run-time error 6124 : You are not allowed to edit this selection because it is protected'. This occurs for the tenant.Text = Range("tenant").Value code.
previously this code work properly on office 2019 but error on office 2016
When you go to the Developer tab, and click the "Restrict Editing" button it'll to show task pane with protection in current document. Else it is possible you're writing to uneditable region (like the end or beginning of a row).
@@VBAA2Z Thanks for your feedback.
I've follow your suggestion and checked on restrict editing, but on formating restriction and editing restriction already on unchecked position.
And If else any issue on uneditable region, this code should be error on office 2019 also right?
What is the trick to reference the same word bookmark multiple times? I tried to use a cross reference, but that doesn't seem to work
hey i have problem in error 6124 "You are not allowed to edit this selection because it is protected" do you know to fix this proble?
Great work done highly appreciated.
Thank you! Cheers!
Hello, thanks for this wonderful tutorial. Can you please tell me how to program it to be entering these values from a nice UI without opening excel.
please check these videos
ua-cam.com/video/p93JRjTFWmc/v-deo.html
One word...awesome....
Thank you so much 😀
Wowow this is great
thanks!
Great Video !! Can you make a video to replace images in "Word" using "Excel" along with sizing of those images !!
thanks and great suggestion! will share something here or on blog.
@@VBAA2Z I'll do check the blog out but the video would be great for me & all viewers as well!!
Sir from where can I get this word file ? Of lease agreement
Hi, excellent video
How can I do if I have several times that I have to enter the same data, in order not to enter different markers for the same text, I tried to use cross reference but it has not worked
If you want to write to same range multiple times without closing the file
first get the bookmark range address and keep reusing it by creating bookmarks on runtime. hope it helps.
Thank you! Nice tutorial.
You're welcome!
Hi. Thanks a lot
But how can i save the file with different name each time without changing it in macros
create a template file and open that instead of the code file
Can it be done through python if yes then how?
Use python-docx
Hi!
I have a problem i cant find the reference for microsoft word in my visual basic app,
could you please help me with this ??
Thank you
This might help : docs.microsoft.com/en-us/previous-versions/office/troubleshoot/office-developer/automate-word-create-file-using-visual-basic
@@VBAA2Z Thank you!
superb, thank you
you're most welcome
my document is opening in read only format can u please help me
set read only parameter to false
Hi! When I run the code it prompted that "Run-time error '6124' You are not allowed to edit this selection because it is protected". For the set rng_cdate it runs smoothly, but for the tenant.Text=Range("Tenant").Value and landlord.Text=Range("Landlord").Value it failed. Could u please suggest how can I fix the error?
Try ActiveDocument.Unprotect Password:="your password" before running the code
hi sir this is really help full for me thanks for this tutorial but i have one question is their any possibility of automation between Word and publisher
Yes, you can
@@VBAA2Z plz guide me
@@sonisingh4556 May I know what you're trying to achieve?
@@VBAA2Z sir plz make one video on publisher and word automation like if we add any text or image(chart) in publisher its will automatically add in word document
thanks for this helpful tutorial.
You're welcome!
very informative, thanks sir
Bro, do you have a tutorial of this from the scratch. You should also explain on how can we add the object library. It's already open on yours
Hi Jeffrey, this is from scratch. To add reference simply goto
Tools >> References >> [ check ] Microsoft Word *** library >> click on OK
Great Tutorial - thank you
No matter what I do with the date I cannot get it to copy to the Word Document in the same format
My spreadsheet displays as 22 January 2021 but when you view the Word Document it displays as 22/01/2021
Please help
have you tried formatting it like below bookmark object?
rng_cdate.Text = Format(Range("Contract_Date"), "MMMM dd, yyyy")
thanks VBA A2Z !! can you make play list for excel word and powerpoint separarely
Sure, please check below.
PPT: ua-cam.com/play/PLo0aMPtFIFDoSJKFqFpjjUOVvpPvSOag8.html
Word: ua-cam.com/play/PLo0aMPtFIFDpoFM9Th51ute2796xwPg7J.html
All playlist: ua-cam.com/users/vbaa2zplaylists?view=1
Hi! Thank you for this tutorial. I am a begginer in VBA. I followed your code. When I run it, I get User-defined type not defined with reference to Sub ExportToWord (). Could you give me a hint what can be wrong?
Additionally, I was trying to look for this material to download on your website, but unfortunately it looks missing. Could you refer where I can find it?
Ensure word library is referenced.
How to transfer data including tables and paragraphs in different worksheets (having user form containing check boxes, selection button, list etc to choose from) into a single word document at a particular location only under different clauses using vba. For example word document first page is cover sheet having project name client name date , 2nd page is index sheet with clause number and page reference. 3rd page starts with clause 1.0 as introduction. 2 scope of supply and so on.
It should take data from excel and paste at particular locations on click of button
Check this 2 videos. It'll give you google ides to work with Word Objects and also with word table.
ua-cam.com/video/KoTuy92uboY/v-deo.html
ua-cam.com/video/RQgOxv6nrE0/v-deo.html
Create a dummy table in template word file and write to it.
All the best!
Thanks there
May I get help on file .dotm without password but can not access the code? Tks ad
not sure I understand. trying to reset vba password?
tks
Thanks
Welcome
I am needing this so bad for work. Can you help me?
Please download from here: vbaa2z.blogspot.com/2020/12/you-can-support-vba-a2z-by-simply.html
Feel free to post your here if any
Fast pace, but nice work!
Thanks!
Thank you!
You're welcome! thanks for watching.
i am trying to understand, what is the value in this ?
which value/?
Can we do VBA automation from word to word doc?
of course
Could you do it on a Mac?
I currently don't own a mac, if you use mac please test it out and let me know
it should work
Hi !
I'm having an issue with an error saying 'Compile error : Argument not optional'. This occurs for the doc.ExportAsFixedFormat code.
Could you please help me with this ??
Thank you.
Hi, ensure you password all mandatory parameters.
thanks!
No problem!
i have to work on word doc using coding, can anyone help in this.
try stackoverflow platform
any specific questions, feel free to post here too
@@VBAA2Z yes.. i have to prepare a manual letter in word file, where i need to update the information for particular person, like name ,address, amount at a specific position. i want coding for this.
thank you so much!
you're most welcome!
Thank you
You're welcome
thanks
It gives me the error saying that my word document is protected and cannot be edited. Anyone who can help?
it must be password proected
👍👍
You cannot use bookmarks for data in column 😔😔
try this learn.microsoft.com/en-us/office/vba/api/word.bookmark.column
Hi,
I have 1000 pages in word document
In that 1st page has two highlighted word in two different places
And I want to highlight rest 999 page at exact the same location ...
Can you please share the VBA code for that
My Word didn't change at all
make sure the bookmarks are set up
also debug line by line and see if it errors
The instruction is all over the place as though you forget maybe new people are trying to follow along. You already had windows opened and didn't explain where they came from and why 😑
Thanks for visit. Check here for basics on word app - support.microsoft.com/en-us/topic/7bcd85e6-2c3d-4c3c-a2a5-5ed8847eae73
I didn’t liked your way of explaining because because you do all the work yourself.
It looks as if you’re talking to yourself.
hope you find videos that helps.
Thank you...
You're welcome!
thank you
you're most welcome!