+ Reply to Thread
Results 1 to 4 of 4

Visual basic message box error

  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Visual basic message box error

    Hi, I have a macro run when a workbook opens.

    I have just moved it to perform automatic run when the book opens but I get a "complie error" highlighting the me.visible part of the code.

    Anyone with any idea's why the code isn't working?

    Incidentally, r1 is the current date, and s1 is a preset date - so I need the message box to alert once the current date (r1) has passed teh set date (s1)


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: Visual basic message box error

    Since you moved it out of some module into "This Workbook" and set it to run when opened, it no longer knows what the ME part of me.visible is. You have to change that back to the name of whatever you're trying to make visible. For example, if you have a form that should pop up and that form is called "UserForm1" then replace me.visible with UserForm1.visible.

  3. #3
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Visual basic message box error

    ^ Almost agree with above except I'd say the insinuation from the hidden values (xlsheetveryhidden) is that the macro was created in a sheet's code and moved (gracelessly?) into the workbook open event. I think replacing all instances of
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    would do it.

    CC

  4. #4
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Re: Visual basic message box error

    Thanks guys, will give it a bash

+ 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