Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default vbscript question...

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default vbscript question...

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?



rosen wrote:

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


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run VBScript from Excel Amy M Excel Discussion (Misc queries) 4 September 19th 08 09:07 PM
Anoth vbscript question ... sorry ! Sean Setting up and Configuration of Excel 1 March 20th 08 09:22 PM
VBscript sebastienm Excel Programming 0 September 22nd 04 08:24 PM
VBscript raji Excel Programming 0 September 22nd 04 08:03 PM
Pastespecial via vbscript not working msnews.microsoft.com[_7_] Excel Programming 2 December 20th 03 02:37 PM


All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"