I have to put data from an Access application into an Excel file.
I have to Copy and Delete Worksheets in the Workbook.
My code in CommandButton_Click:
Set MyWorkbook = GetObject(constFolder & “\Test.xls”, “Excel.Sheet”)
Set MyWorksheet = MyWorkbook.Worksheets(“Sheet1”)
MyWorkbook.Windows(“Test.xls”).Visible = True
MyWorkbook.Application.Visible = True
MyWorksheet.Copy After:=MyWorksheet
It works. But all the adding and deleting is visible for the user.
How can I make the Workbook Active and use the Copy Method without it being visible???
I have tried:
MyWorkbook.Activate
Instead of:
MyWorkbook.Windows(“Test.xls”).Visible = True
Te Copy Method failed