+ Reply to Thread
Results 1 to 3 of 3

Macro opening file

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2007
    Posts
    15

    Macro opening file

    Hello,

    I created a macro to open a file. The macro is attached to a command button . The code is below.
    The macro works fine when opening the file, but , if you already have the file already opened , you get an error and the macro is debugged . What I want to do is to avoid this error when the user already has the file open and just receives a message that says this.

    Thank you in advance!

    Code :
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Macro opening file

    Add "onerror resume next" at the start of your code

  3. #3
    Registered User
    Join Date
    04-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Macro opening file

    Thanks a lot!
    it works !

+ 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