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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code Automation Issue with Refresh

Status
Not open for further replies.

DBSSP

Programmer
Apr 1, 2002
327
US
I'm currently having a problem with my code. The workbook is saving and exiting immediately, interuppting the refreshall command. Is there anyway I can stop this from happening while maintaining the transparency.


Begin Code
***********************************************************
Function UpdateRatio()

Dim XL As Excel.Application


Set XL = New Excel.Application

XL.Workbooks.Open "J:\Tracker Database\Tracker\Scheduling by TL\Schedule Ratio.xls"
XL.Application.DisplayAlerts = False
XL.ActiveWorkbook.RefreshAll
XL.ActiveWorkbook.Save
XL.Application.Quit

Set XL = Nothing
MsgBox "Updates completed successfully!", vbOKOnly, "Update Success"

End Function
***********************************************************
End Code

Jay
 
Clear the check box for Enable Background Refresh of your Excel Worksheet (Data/Get External Data/Data Range Properties).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top