vbscript question...

  • Thread starter Thread starter rosen
  • Start date Start date
R

rosen

If I want to perform a data base update (i.e. same as hitting "!" in
the UI) from a vbscript what command should I use....

SpreadSheet = "D:\test.xls"

' Create the Excel application object
Dim Excel
Set Excel = CreateObject ("Excel.Application")
Excel.Visible = True

Excel.Workbooks.Open SpreadSheet

Excel.Refresh <---- This is giving me an error
Excel.Workbooks.Close
Excel.Quit
 
This seemed to work ok.

SpreadSheet = "D:\test.xls"
Dim Excel
dim Wkbk

Set Excel = CreateObject ("Excel.Application")
Excel.Visible = True

set wkbk = Excel.Workbooks.Open (SpreadSheet)

wkbk.RefreshAll
wkbk.Close true 'save changes???
Excel.Quit

set wkbk = nothing
set excel = nothing

===============
Did you want to save your changes?
 
Back
Top