+ Reply to Thread
Results 1 to 4 of 4

Getting a runtime error if I have two workbooks open

  1. #1
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Getting a runtime error if I have two workbooks open

    Hey Guys,

    I have this code in a module. If I have this workbook open and another one and if the other one is active and I close excel with the red x in the corner I get a runtime error with the bit below in red highlighted. I assume I need to add a "Thisworkbook.active" but it doesn't seem to work. I ave tried it in the this workbook code under before close and also in the below module but neither worked.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,027

    Re: Getting a runtime error if I have two workbooks open

    You probably need
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Getting a runtime error if I have two workbooks open

    Hey @TMS,

    That worked perfect. Thanks a mil.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,027

    Re: Getting a runtime error if I have two workbooks open

    You're welcome. Thanks for the rep.

+ 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. [SOLVED] Runtime Error 9, open debug and macro completes
    By Aaron092 in forum Excel Programming / VBA / Macros
    Replies: 42
    Last Post: 11-03-2014, 10:09 AM
  2. [SOLVED] Workbooks.Open method and runtime error 1004 - "file couldn't be found".
    By PHBlaz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-28-2014, 02:10 PM
  3. [SOLVED] Runtime Error 1004 when Copying worksheets from multiple workbooks into current workbook
    By dharris42 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2013, 11:56 AM
  4. SaveCopyAs Runtime Error 1004 - save a backup without altering open file
    By kamelkid2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2013, 08:11 PM
  5. [SOLVED] Runtime Error '70' when copying a file that is open
    By LoneWolf3574 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-06-2012, 02:22 AM
  6. Replies: 1
    Last Post: 08-04-2009, 10:43 PM
  7. runtime error recived for some trying to open document
    By webguync in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-26-2009, 05:29 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