Solved

How to suppress Excel macro warning dialogs when using Word's InlineShapes.AddOLEObject

Posted on 2003-11-09
3
2,138 Views
Last Modified: 2007-12-19
Using  Selection.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.8", FileName:= _
        "C:\Documents and Settings\Anne Troy\Desktop\MyVlookup.xls", LinkToFile:= _
        True, DisplayAsIcon:=False
on a spreadsheet containing macros causes Excel to present 3 successive dialog boxes warning about macros. Is there a way to bypass these dialogs?
0
Comment
Question by:ramrom
  • 2
3 Comments
 
LVL 80

Expert Comment

by:byundt
ID: 9710810
Hi ramrom,
Try the following:
Application.DisplayAlerts=False
'Your code
Application.DisplayAlerts=True

Cheers!

Brad
0
 
LVL 17

Author Comment

by:ramrom
ID: 9710827
That does not do it. It is Excel, as I said, that displays the warning, not Word, and I'm automating Word.
0
 
LVL 80

Accepted Solution

by:
byundt earned 125 total points
ID: 9710848
ramrom,

Dim xlApp as Object
Set xlApp=CreateObject("Excel.Application")
xlApp.DisplayAlerts=False
'Your code
xlApp.DisplayAlerts=True

Brad
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
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.

746 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

11 Experts available now in Live!

Get 1:1 Help Now