ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Prevent Word Document_Open from running (https://www.excelbanter.com/excel-programming/419257-prevent-word-document_open-running.html)

Rich

Prevent Word Document_Open from running
 
When opening a Word doc from Excel VBA, I want to prevent the Document_Open
routine in the Word doc from automatically running.

Application.EnableEvents = False in Excel doesn't stop the Word macro from
running - and there seems to be no equivalent command in Word.

Putting wdDoc.UserControl = False/True in the Word macro doesn't seem to
make any difference - the macro still runs.

Any tips?

DMoney

Prevent Word Document_Open from running
 
This may be a long shot, but you if you know the sequence of keys to hold
down when opening word that prevents the code from running, you could try the
sendkeys command in excel VBA.


"Rich" wrote:

When opening a Word doc from Excel VBA, I want to prevent the Document_Open
routine in the Word doc from automatically running.

Application.EnableEvents = False in Excel doesn't stop the Word macro from
running - and there seems to be no equivalent command in Word.

Putting wdDoc.UserControl = False/True in the Word macro doesn't seem to
make any difference - the macro still runs.

Any tips?



All times are GMT +1. The time now is 04:29 PM.

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