Results 1 to 4 of 4

Macro to close two workbook

Threaded View

JamesT1 Macro to close two workbook 04-23-2019, 11:18 AM
Greg M Re: Macro to close two... 04-23-2019, 11:44 AM
JamesT1 Re: Macro to close two... 04-23-2019, 11:59 AM
Greg M Re: Macro to close two... 04-23-2019, 03:03 PM
  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    430

    Macro to close two workbook

    Good afternoon all

    I have two workbooks,,,, 'Driver Database' (DD) and 'Driver Standard Routes' (DSR)..

    In the userform on the DD i have a command button to close the userform and open the DSR Sheet... this works OK...

    On the DSR I have command button to clost the DSR, this works OK,, but I also need it to close the DD sheet... I have been trying various version of the code, including switching the two lines around,, but cannot get it to close the DD sheet

    Any help would be very much appreciated

    Many thanks JT

    Private Sub cmdclose_Click()
    Unload Me
    
    ActiveWorkbook.Close SaveChanges:=True
    
    Workbooks("Driver Database.xlsm").Close SaveChanges:=True
    
    End Sub
    Last edited by JamesT1; 04-23-2019 at 11:19 AM. Reason: Update

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy from first workbook, close open new workbook paste close
    By johncarr1952 in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 08-04-2021, 08:50 AM
  2. Macro VBA Excel : save and close a workbook from another workbook macro
    By estelleh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2019, 07:09 AM
  3. [SOLVED] Macro to close all workbooks except active workbook and one other named workbook
    By picton2000 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-01-2017, 06:03 PM
  4. [SOLVED] Issue with Open, copy, close Macro - when trying to close workbook Clipboard error
    By seanpcorbett1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-13-2016, 05:14 PM
  5. Macro to close workbook and replace with new workbook
    By chinaboy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-24-2012, 09:05 PM
  6. 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

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