Solved

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

Posted on 2003-11-09
3
2,143 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 81

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 81

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed. With this simple solution, if the user tries to …
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

910 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

18 Experts available now in Live!

Get 1:1 Help Now