How do I switch between open files in Excel using AS? Say I have 2 files open and I want to switch back and forth between them and do some stuff in AS…I have tried things like
activate object sheet target_excel
to no avail.
Thanks.
Pedro
How do I switch between open files in Excel using AS? Say I have 2 files open and I want to switch back and forth between them and do some stuff in AS…I have tried things like
activate object sheet target_excel
to no avail.
Thanks.
Pedro
Hi,
it depends on the purpose to activate a document or a sheet within a document
to activate a document
tell application "Microsoft Excel"
activate object workbook "myWorkBook"
end tell
to activate a sheet
tell application "Microsoft Excel"
activate object sheet "mySheet" of workbook "myWorkBook"
end tell