vbscript question...

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
 
D

Dave Peterson

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top