Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbooks Open Statement
Dear Experts ,
I am using the following code in a loop to open a number of sheets in a directory however I do not know if I can improve this line of code to deal with sheets which have auto start macros - ideally I would like to ignoar the auto start Workbooks.Open Filename:=sPath & sFile, _ Password:="tiger", UpdateLinks:=0, WriteResPassword:="tiger" If you can suggest how I can improve this please feel free and I thank you advance , also if you think of an area my open statement does not process I would be interested in your knowledge. As always kind regards Chris W -- C Ward |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbooks Open Statement
Try disabling the events....
Application.EnableEvents = False 'Your code Application.EnableEvents = True If this post helps click Yes --------------- Jacob Skaria "christopher ward" wrote: Dear Experts , I am using the following code in a loop to open a number of sheets in a directory however I do not know if I can improve this line of code to deal with sheets which have auto start macros - ideally I would like to ignoar the auto start Workbooks.Open Filename:=sPath & sFile, _ Password:="tiger", UpdateLinks:=0, WriteResPassword:="tiger" If you can suggest how I can improve this please feel free and I thank you advance , also if you think of an area my open statement does not process I would be interested in your knowledge. As always kind regards Chris W -- C Ward |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbooks Open Statement
I don't think Workbook open run the Workbook Open Events or Auto run events.
"christopher ward" wrote: Dear Experts , I am using the following code in a loop to open a number of sheets in a directory however I do not know if I can improve this line of code to deal with sheets which have auto start macros - ideally I would like to ignoar the auto start Workbooks.Open Filename:=sPath & sFile, _ Password:="tiger", UpdateLinks:=0, WriteResPassword:="tiger" If you can suggest how I can improve this please feel free and I thank you advance , also if you think of an area my open statement does not process I would be interested in your knowledge. As always kind regards Chris W -- C Ward |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbooks Open Statement
Thanks Jacob I am hoping I have covered the events already as shown below
With Application calcmode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False .EnableEvents = False End With -- C Ward "Jacob Skaria" wrote: Try disabling the events.... Application.EnableEvents = False 'Your code Application.EnableEvents = True If this post helps click Yes --------------- Jacob Skaria "christopher ward" wrote: Dear Experts , I am using the following code in a loop to open a number of sheets in a directory however I do not know if I can improve this line of code to deal with sheets which have auto start macros - ideally I would like to ignoar the auto start Workbooks.Open Filename:=sPath & sFile, _ Password:="tiger", UpdateLinks:=0, WriteResPassword:="tiger" If you can suggest how I can improve this please feel free and I thank you advance , also if you think of an area my open statement does not process I would be interested in your knowledge. As always kind regards Chris W -- C Ward |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbooks Open Statement
Hi Chris
Just try this. Open a new workbook. Launch VBE alt+F11. Within Activeworkbook Open place a msgbox. Save and close. Everytime when you open the workbook it should display the messagebox (even open through code). Now from another workbook module create a macro to open the same workbook with Application.EnableEvents = False Workbooks.Open <filename Application.EnableEvents = True It should not initiate any events...the msgbox will not be displayed If this post helps click Yes --------------- Jacob Skaria "christopher ward" wrote: Thanks Jacob I am hoping I have covered the events already as shown below With Application calcmode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False .EnableEvents = False End With -- C Ward "Jacob Skaria" wrote: Try disabling the events.... Application.EnableEvents = False 'Your code Application.EnableEvents = True If this post helps click Yes --------------- Jacob Skaria "christopher ward" wrote: Dear Experts , I am using the following code in a loop to open a number of sheets in a directory however I do not know if I can improve this line of code to deal with sheets which have auto start macros - ideally I would like to ignoar the auto start Workbooks.Open Filename:=sPath & sFile, _ Password:="tiger", UpdateLinks:=0, WriteResPassword:="tiger" If you can suggest how I can improve this please feel free and I thank you advance , also if you think of an area my open statement does not process I would be interested in your knowledge. As always kind regards Chris W -- C Ward |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbooks Open Statement
Many thanks
-- C Ward "Jacob Skaria" wrote: Hi Chris Just try this. Open a new workbook. Launch VBE alt+F11. Within Activeworkbook Open place a msgbox. Save and close. Everytime when you open the workbook it should display the messagebox (even open through code). Now from another workbook module create a macro to open the same workbook with Application.EnableEvents = False Workbooks.Open <filename Application.EnableEvents = True It should not initiate any events...the msgbox will not be displayed If this post helps click Yes --------------- Jacob Skaria "christopher ward" wrote: Thanks Jacob I am hoping I have covered the events already as shown below With Application calcmode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False .EnableEvents = False End With -- C Ward "Jacob Skaria" wrote: Try disabling the events.... Application.EnableEvents = False 'Your code Application.EnableEvents = True If this post helps click Yes --------------- Jacob Skaria "christopher ward" wrote: Dear Experts , I am using the following code in a loop to open a number of sheets in a directory however I do not know if I can improve this line of code to deal with sheets which have auto start macros - ideally I would like to ignoar the auto start Workbooks.Open Filename:=sPath & sFile, _ Password:="tiger", UpdateLinks:=0, WriteResPassword:="tiger" If you can suggest how I can improve this please feel free and I thank you advance , also if you think of an area my open statement does not process I would be interested in your knowledge. As always kind regards Chris W -- C Ward |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel2007; workbooks.count is not counting all open workbooks | Excel Programming | |||
VBA Excel.WorkBooks.Open can't open an XML format xls file | Excel Programming | |||
When I open Excel, workbooks open automatically. How can I stop t | Excel Discussion (Misc queries) | |||
workbooks.open function fails to open an existing excel file when used in ASP, but works in VB. | Excel Programming | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming |