Question

Locked

How can I make the Workbook Active and use the Copy Method ?

By irinar ·
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

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Back to Software Forum
1 total post (Page 1 of 1)  

Related Forums