Results 1 to 2 of 2

Open, Enable Automatic Refresh and save excel file using vbs

Threaded View

wattsy29 Open, Enable Automatic... 01-20-2011, 07:05 PM
pike Re: Open, Enable Automatic... 01-21-2011, 05:30 AM
  1. #1
    Registered User
    Join Date
    01-20-2011
    Location
    Mackay, Queensland
    MS-Off Ver
    Excel 2003
    Posts
    1

    Open, Enable Automatic Refresh and save excel file using vbs

    Hi all
    I am trying to open an excel file enable automatic refresh then save the file and close using a vbs.
    The problem i am having is i need to enable automatic refresh when the file opens.
    I could use a sendkey command but i was wondering if there is another way.

    This is what i have so far
    Set xl = CreateObject("Excel.application")
    
    xl.Application.Workbooks.Open "c:\Data\Graphing.xls"
    
    'sets it so you can see the file
    xl.Application.Visible = True
    
    'xl.application.displayalerts = false
    
    xl.ActiveWorkbook.Save
    xl.Application.Quit
    
    CurrentDate = Now
    
    Wscript.Echo "Bitlab Data Update Correctly " & FormatDateTime(CurrentDate, vbShortDate)
    
    
    set xl = Nothing
    Thanks rhyan
    Last edited by pike; 01-21-2011 at 04:54 AM. Reason: add code tags for newbie PM warning

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1