Skip to Content
author's profile photo Former Member
Former Member

Closing workbook from VBA

Hi.

I have workbook with macro which formats result of query and saves it as pdf file on user's pc.

At the end of execution macro should close current workbook.

I use the code:

ActiveWorkbook.Close (False)

but critical error occurs!

How can i solve this problem?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Sep 09, 2013 at 08:40 AM

    Try with Workbooks("Workbook Name.xls").Close Savechanges:=True

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.