+ Reply to Thread
Results 1 to 3 of 3

ActiveWorkbook.Close issues

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2010
    Posts
    40

    ActiveWorkbook.Close issues


    I'm having some trouble with the ActiveWorkbook.Close actions in Excel VBA.

    The macro is closing the ControlFile instead of the active sheet. Is there another way to do this or does anyone know where I am going wrong in the code?



    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: ActiveWorkbook.Close issues

    Which workbook do you actually want to close?

    There seems to be 3 workbooks involved in the code, 2 that you open and 1 that presumambly is already open.

    One thing you could do to keep track of the workbooks is set variables that refer to them

    For example:
    Please Login or Register  to view this content.
    You can use a reference like this to refer to this workbook in the code.

    For example to close it.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-19-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: ActiveWorkbook.Close issues

    Thanks, I'm going to try that. It's a great idea!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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