Dear all,
I am using the Excel Table to store some records, then using VBA copy the a lot of data to winword table and generate the report. ( see attached )
My Pseudo code by Excel VBA coding
Copy Excel to Data Array
Open Winword.application
Create a table in winword
then Put the Data Array into the winword
(I want to do something when there is different page)
(so, How can I coding when I copy data to winword that I know the page number ( for example there is in Page 1 or 2 ))
Rename and Saved the file
Close Winword.application
I have tried to set the value / show it in msgbox as below coding.
MsgBox objDoc.tables(1).Cell(1, 1).Range.Information(wdActiveEndPageNumber)
' Report the existing cell (try the First cell) which page is located but failed as 'Run-time error 4608 / Value out of range'
I am using the Excel Table to store some records, then using VBA copy the a lot of data to winword table and generate the report. ( see attached )
My Pseudo code by Excel VBA coding
Copy Excel to Data Array
Open Winword.application
Create a table in winword
then Put the Data Array into the winword
(I want to do something when there is different page)
(so, How can I coding when I copy data to winword that I know the page number ( for example there is in Page 1 or 2 ))
Rename and Saved the file
Close Winword.application
I have tried to set the value / show it in msgbox as below coding.
MsgBox objDoc.tables(1).Cell(1, 1).Range.Information(wdActiveEndPageNumber)
' Report the existing cell (try the First cell) which page is located but failed as 'Run-time error 4608 / Value out of range'