Solved

VBA Stop other macros running when opening linked Excel file

Posted on 2006-06-12
3
324 Views
Last Modified: 2012-06-21
Hi,

I am having a problem with macros running in an excel file when I open it in the background to update linked data in my word tables.  I am aware that you can turn macros off in Excel by using the Application.EnableEvents = False command but do not know how to fit this in with my current Open Excel File command.  Any Ideas?

Below is the line that I am currently using in the opening of the excel file

Set mobjXLWorkBook = mobjXLApp.Workbooks.Open(FileName:=strPath, UpdateLinks:=False, ReadOnly:=blnReadOnly)
0
Comment
Question by:wobbled
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 250 total points
ID: 16887084
It's a shame that that method isn't availble to the Word Application as well.

However, it would seem logical to try:

mobjXLApp..EnableEvents = False
Set mobjXLWorkBook = mobjXLApp.Workbooks.Open(FileName:=strPath, UpdateLinks:=False, ReadOnly:=blnReadOnly)
0
 
LVL 17

Author Comment

by:wobbled
ID: 16901000
I agree that Word would benifit from such a method.

Did the job fine

Thanks

W
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16901057
Thanks. I've just noticed my error (two dots instead of one). Sorry about that.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now