+ Reply to Thread
Results 1 to 4 of 4

Close file after VBA script runs command

  1. #1
    Forum Contributor
    Join Date
    11-19-2019
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    463

    Close file after VBA script runs command

    I have vb code that saves a file in 2 locations but when the code runs it leaves the file open. Is there a way to augment this code so that when it runs it closes the file when it saves in those 2 locations?



    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    1,909

    Re: Close file after VBA script runs command

    You should be able touse the .close property to accomplish that. For instance,

    Please Login or Register  to view this content.
    Last edited by maniacb; 08-16-2020 at 05:30 PM. Reason: Corrections to response

  3. #3
    Forum Contributor
    Join Date
    11-19-2019
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    463

    Re: Close file after VBA script runs command

    I am sorry but I am still learning VBA can you incorporate your code to my code above? Please?
    Do I just put your at the bottom of mine?

  4. #4
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    1,909

    Re: Close file after VBA script runs command

    Please Login or Register  to view this content.

+ 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. Command button that runs a command
    By redvan22 in forum Excel General
    Replies: 1
    Last Post: 04-21-2019, 04:12 PM
  2. Script/macro to save a copy as tab delimited text file and then close original file
    By Merlin803 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2015, 01:34 PM
  3. Script runs on other workbooks
    By CKlapperich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2014, 04:05 PM
  4. [SOLVED] VBA script to close Excel file opened in Outlook
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2014, 09:59 AM
  5. Close current tab of excel file in IE with script?
    By WL2005HBD in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2014, 09:34 PM
  6. 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
  7. Script that edits the text printed on the button that runs the script
    By petalred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2008, 02:41 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