Deactivate automatic macros on import

G

Guest

Hi All......
I am trying to open a second Excel file and retrieve a copy of one of the
worksheets. I've done this many times successfully, with other files, but
this one has automatic macros attached to the sheet and workbook modules
which are messing things up by trying to engage. How might I be able to open
this book and copy a sheet from it to another workbook, and in so doing,
disable all the sheet and workbook macros?.....and circumvent the "workbook
is in use, do you want to open read-only" message.

TIA
Vaya con Dios,
Chuck, CABGx3
 
D

Dave Miller

Disable events before you open the workbook:

Application.EnableEvents = False

Remember to enable again after you are done with the sheet.

Regards,
David Miller
 
G

Guest

Thanks David.....but I still can't get past the "file is in use, open as
read-only?" message.

Vaya con Dios,
Chuck, CABGx3
 
G

Guest

To close the loop............I wasn't able to get there with any sort of a
Copy and Paste procedure, but was finally able to get what I needed by using
a macro to run a custom MSQuery.

Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top