+ Reply to Thread
Results 1 to 4 of 4

Open External File, Write Data, Save and Close without prompt.

  1. #1
    Registered User
    Join Date
    09-28-2015
    Location
    RI, USA
    MS-Off Ver
    2010
    Posts
    42

    Open External File, Write Data, Save and Close without prompt.

    I am trying to open an external data file to write and store data from my current worksheet. I put in msgbox to ensure data is what I want. The code below places the desired data in the desired ranges, but will not save the file with that data in it. Must be something simple that I am missing. I do not want a prompt in saving the data.

    Please Login or Register  to view this content.
    As a note, when I reverse these two ranges it moves from the external file to my current file correctly as shown below.

    Please Login or Register  to view this content.
    As I said, I can see with the message box break that the data is in the correct place before the file is closed. It just won't save that data. Those ranges that were filled before closing are blank when I reopen the external file

    First three msgboxes will not be needed once complete. They are just there to make sure information is right at that point, which it is. Only the fourth box will remain once I can get this to save the data to confirm the action to the user..

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    5,839

    Exclamation Re: Open External File, Write Data, Save and Close without prompt.


    Hi !

    Correction : objWorkbook.Close SaveChanges:=True or objWorkbook.Close True

    Do you like it ? So thanks to click on bottom left star icon Add Reputation !

  3. #3
    Registered User
    Join Date
    09-28-2015
    Location
    RI, USA
    MS-Off Ver
    2010
    Posts
    42

    Re: Open External File, Write Data, Save and Close without prompt.

    Amazing. Thanks so much

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    5,839

    Re: Open External File, Write Data, Save and Close without prompt.


    As written in Workbook.Close VBA help and its sample …

    Thanks for the rep' !

+ 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. [SOLVED] Don't want get open file name and write data on close workbook
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-25-2014, 12:56 AM
  2. [SOLVED] How to Stop Macro From Requiring File Open Prompt When Changing External WB Reference?
    By justinbelkin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-16-2013, 02:34 PM
  3. Macro to Open a file, transfer data, save and close
    By tforbes75 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2011, 11:59 AM
  4. How to: Open file, format data, save file, close file and repeat.
    By thexeber in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2010, 12:56 PM
  5. Auto close, save to new file without prompt
    By Bafa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2007, 10:31 AM
  6. Intercepting the file save prompt before close?
    By Neil Bhandar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2006, 11:20 PM
  7. CLOSE ALL macro for XL2K (but with prompt to save for each file)?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2005, 10:05 AM

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