Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Storing A Variable on Close

  1. #11
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I tested it
    Found this error

    If Err.num = 53 Then

    Should be

    If Err.Number = 53 Then

    Besides that it works

    Tom

  2. #12
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Wow - yes it does work. However, will it work if I have the file in one directory, click the box, save, close, move the file and open again.

    If not, I would rather try the name method suggested above [the code makes more sense to me].

  3. #13
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Tom,

    How can I turn the form back on? For some reason I am having trouble with that.
    Thanks in advance,
    Patrick

  4. #14
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Got it

  5. #15
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    If you want the form to show when the workbook is moved:

    In Sub CheckFileSwitch()

    Change:

    Open Application.Path & "/noopen" For Input As #1

    To:

    Open ActiveWorkbook.Path & "/noopen" For Input As #1

    In Sub CheckBox1_Click()

    Change:

    Open Application.Path & "/noopen" For Output As #1

    To:

    Open ActiveWorkbook.Path & "/noopen" For Output As #1
    Hope this helps,
    Tom

  6. #16
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Tom!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •