Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Deactivate automatic macros on import

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Deactivate automatic macros on import

Disable events before you open the workbook:

Application.EnableEvents = False

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

Regards,
David Miller

  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Deactivate automatic macros on import

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

Vaya con Dios,
Chuck, CABGx3



"Dave Miller" wrote:

Disable events before you open the workbook:

Application.EnableEvents = False

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

Regards,
David Miller


  #4   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Deactivate automatic macros on import

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

"CLR" wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Shared Workbook" seems to deactivate features like macros Steve Excel Discussion (Misc queries) 3 May 1st 07 05:11 PM
How to deactivate the external queries that are used to import dat NickHK Excel Programming 0 January 4th 07 02:04 AM
automatic import from excel Phil H Excel Discussion (Misc queries) 3 May 2nd 05 08:38 PM
Automatic Data Import TxRaistlin Excel Discussion (Misc queries) 2 February 4th 05 10:43 PM


All times are GMT +1. The time now is 01:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"