Hey all,
I've got a macro in an excel sheet, which when invoked should -
- pick up data from the sheet and create an email based on specific cell values
- open a specific word document and run a macro in the word document that would add a few user-specified number of rows in a table and then print it out
What i would also like to do is, before printing, paste variables passed from excel in the document
Everything works perfectly except for the passing variables from the excel macro to the word macro part. I cant seem to figure out the syntax to do that. I always send up with Error 450 "Wrong number of arguments or invalid property assignment "
(the word document prints, as long as i dont pass the variables)
EXCEL MACRO SECTION -
...
Set appWD = CreateObject("Word.Application")
appWD.Visible = True
appWD.Documents.Open Filename:="C:\Attendence Record.doc"
appWD.Run "PrintTable", "var1", "var2", "var3"
...
So, how do I pass these variables to the PrintTable macro in word?