+ Reply to Thread
Results 1 to 2 of 2

Open/Save/Close Workbook via command button

  1. #1
    Registered User
    Join Date
    03-11-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    17

    Open/Save/Close Workbook via command button

    Hi. I have a command button that needs to open a workbook, save, then closed automatically. No need to display the workbook, this is because that workbook is connected to a sharepoint list and just needs to be opened to refresh the data. Workbook is set to "Refresh the data when opening the file".
    I tried this code

    Workbooks.Open Filename:="C:\Test.xlsx"

    but it is displaying the last data from the excel, i still need to manually open the excel to refresh/update the data

    Can you help me with the code? Thanks in advance!

  2. #2
    Registered User
    Join Date
    03-30-2015
    Location
    Barbados
    MS-Off Ver
    2013
    Posts
    4

    Re: Open/Save/Close Workbook via command button

    Hi have you considered using the Workbook.RefreshAll method? I this would work hand in hand with
    VBA.CreateObject("Excel.application") assigned to an object variable
    Feel free to visit my store at www.ebdapps.com

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Create a Command Button to "Save As" and "Close" an Excel Workbook
    By thedunna in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-26-2013, 05:38 PM
  2. Disable close workbook but still force users to close thru command button
    By rathig in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2013, 07:29 AM
  3. How to open,save and close another workbook from the current workbook using macro?
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2012, 10:42 AM
  4. button to save and close the workbook
    By Darrell456 in forum Excel General
    Replies: 3
    Last Post: 12-14-2009, 03:54 AM
  5. Save an open workbook, then open template workbook and close the saved workbook
    By ondvirg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 10:20 PM

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