Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make msgbox not visible 1

Status
Not open for further replies.

willyboy58

Technical User
May 29, 2003
86
US
I have the following code:

Sub OpenReportMonthWorkbook()
Workbooks.Open Filename:="Prop1-" & ReportMonth & ".xls"
ActiveWorkbook.LinkSources (xlOLELinks)
With ActiveWorkbook
.UpdateLink .LinkSources = True
End With
Sheets("InvoicePage2").Select
End Sub

It works except that I do not want the message box with the "Update links...." message box popping up and asking me if I want to update the links or not. How do I hide the message box and still make the update? I'm sure the visible property is involved, but what is the name of the box?

TIA
 
Skip,

I must be missing something. I added the two lines as you suggested, but I still get the update link message box.

I then tried:

Sub OpenReportMonthWorkbook()
'Application.DisplayAlerts = False '<<first try
Workbooks.Open Filename:=&quot;Prop1-&quot; & ReportMonth & &quot;.xls&quot;
ActiveWorkbook.LinkSources (xlOLELinks)
Application.DisplayAlerts = False '<<second try
With ActiveWorkbook
.UpdateLink .LinkSources = True
End With
Sheets(&quot;InvoicePage2&quot;).Select
Application.DisplayAlerts = True
End Sub

I also tried changing my With to:

With ActiveWorkbook
.DisplayAlerts = False
.UpdateLink .LinkSources = True
End With

The procedure that I call to calculate all of the info is in the Prop1Compute workbook; the workbook with the data is called Propxfer which is then saved as &quot;Prop1-(with the month and year added)&quot; . Prop1- is the workbook in the above code and is also the active workbook at this point in time. Can you see anything that I am doing wrong?

TIA
 
Tru adding the UpdateLinks property...
Code:
Workbooks.Open _
   Filename:=&quot;Prop1-&quot; & ReportMonth & &quot;.xls&quot;, _ 
   UpdateLinks:=3
Check HELP for the various value of UpdateLinks and what they mean.

:)

Skip,
Skip@TheOfficeExperts.com
 
Skip, that did the trick. But after the Prop1- workbook is opened, Dr. Watson comes on telling me that I have an application error. Any thoughts?
 
I don't know for sure, but I would avoid using any characters in paths & file names other than alpha numberic characters.

For instance, try getting rid of the &quot;-&quot; in the filename. I would not use &quot;/&quot; or &quot; &quot; either. :)

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top