+ Reply to Thread
Results 1 to 3 of 3

Error when refering to a closed file

  1. #1
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Error when refering to a closed file

    Hello,

    I am running a macro which refers to a file on a different drive.

    If I run the macro with the file not opened, I get an error. However, if I get the macro to open the file, and then execute the code - it runs as expected.

    The code I am trying to run is :-

    Please Login or Register  to view this content.
    Can someone confirm if a file has to be open in this type of instance.

    Thanks

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Error when refering to a closed file

    Hard to tell, since from your code it's not obvious that you are referencing another file.

    Just live with the fact that some stuff only works when the other file is open.

  3. #3
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Error when refering to a closed file

    Quote Originally Posted by teylyn View Post
    Hard to tell, since from your code it's not obvious that you are referencing another file.

    Just live with the fact that some stuff only works when the other file is open.

    Sorry, but is that a yes or a no.

    I am refering to the file in the fist line of the code (mybook)

    I'd rather have the correct answer in this instance as I'd prefer not to open the file if it isnt required.

+ 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