Solved

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

Posted on 2003-11-09
3
2,151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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 article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

728 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