franksirvent
Programmer
Hi,
I am creating an excel sheet report from Access data...
The VB code in Access which creates the excel report is all great, except that the Pagebreak I am trying to insert, I get an error...
This is the code which supposely adds a PageBreak in the CELL selected (the_Rows is the row on the excel sheet which changes with a loop)
xlApp.Range("A" & the_Rows).Select
xlApp.ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
Could anyone advise what is wrong and why is not working?
This is the error I get everytime:
-2147417851 Method Error 'Add' on the object 'HpageBreaks'
Thanks in advance
I am creating an excel sheet report from Access data...
The VB code in Access which creates the excel report is all great, except that the Pagebreak I am trying to insert, I get an error...
This is the code which supposely adds a PageBreak in the CELL selected (the_Rows is the row on the excel sheet which changes with a loop)
xlApp.Range("A" & the_Rows).Select
xlApp.ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
Could anyone advise what is wrong and why is not working?
This is the error I get everytime:
-2147417851 Method Error 'Add' on the object 'HpageBreaks'
Thanks in advance