Consulting

Results 1 to 2 of 2

Thread: code to close workbook

  1. #1

    code to close workbook

    for some reason i cannot figure out or find the code to close only the active workbook.

    application.quit closes all of excel workbooks that are open. i only want to close the the workbook that the userform is in. is there a method for closing the activeworkbook?

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Activeworkbook.Close False or Activeworkbook.Close True depending if you want to save or not.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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