ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Bypass Workbook_Open when opening a workbook with VBA (https://www.excelbanter.com/excel-programming/323010-bypass-workbook_open-when-opening-workbook-vba.html)

Paul

Bypass Workbook_Open when opening a workbook with VBA
 
Hi there,

How can I bypass the Workbook_Open event when opening a workbook with
VBA.

Holding down the shift key does this when opening it manually. The
open event simply brings up a message box which normally a user would
just click OK.

I have tried Sendkeys, but this does not work. Can't find anything in
the help files.

Any suggestions welcome.

Cheers

Paul

Tom Ogilvy

Bypass Workbook_Open when opening a workbook with VBA
 
Application.EnableEvents = False
workbooks.Open "C:\Myforlder\MYfile.xls"
Application.EnableEvents = True

--
Regards,
Tom Ogilvy

"Paul" wrote in message
om...
Hi there,

How can I bypass the Workbook_Open event when opening a workbook with
VBA.

Holding down the shift key does this when opening it manually. The
open event simply brings up a message box which normally a user would
just click OK.

I have tried Sendkeys, but this does not work. Can't find anything in
the help files.

Any suggestions welcome.

Cheers

Paul




Paul

Bypass Workbook_Open when opening a workbook with VBA
 
Thanks Tom,

Obvious when you see it.

Have a great day. Cheers. Paul

"Tom Ogilvy" wrote in message ...
Application.EnableEvents = False
workbooks.Open "C:\Myforlder\MYfile.xls"
Application.EnableEvents = True

--
Regards,
Tom Ogilvy

"Paul" wrote in message
om...
Hi there,

How can I bypass the Workbook_Open event when opening a workbook with
VBA.

Holding down the shift key does this when opening it manually. The
open event simply brings up a message box which normally a user would
just click OK.

I have tried Sendkeys, but this does not work. Can't find anything in
the help files.

Any suggestions welcome.

Cheers

Paul



All times are GMT +1. The time now is 10:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com