+ Reply to Thread
Results 1 to 3 of 3

Variable Not Defined during exit

  1. #1
    Registered User
    Join Date
    06-04-2014
    Posts
    2

    Variable Not Defined during exit

    During exit, and after save occurs, I get "Compile error: Variable not defined". The VS window appears, and the name of one of my form controls is highlighted. There are four ActiveX form controls on the worksheet: two labels and two drop-down lists, and event handlers for the drop-downs. A different control name can be highlighted on different exits

    Why is there compilation at this point? What can I do? Here is sample code, I can see ddlYear or lblDept flagged.

    Please Login or Register  to view this content.
    ...
    Last edited by Leith Ross; 10-21-2014 at 12:42 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Variable Not Defined during exit

    Hello jmc19,

    Welcome to the Forum!

    To help you with this problem you post a copy of your workbook.

    How To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-04-2014
    Posts
    2

    Re: Variable Not Defined during exit

    See attached zip. I've striped the app down to a single report worksheet and switchboard. As you will see, this is my first Excel app. Developed last summer with 2010, now used with 2013.

    Oddly, I got a 90% compression rate when I zipped the .xlsm file. Is that a sign of something wrong?

    Start the app, open the first report, change the Department drop-down, close the report, exit the app. Error appears while app is closing.
    Attached Files Attached Files
    Last edited by jmc19; 10-21-2014 at 03:12 PM.

+ 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. Macro to Insert defined integer into range defined by variable criteria
    By stereofeedback in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2013, 12:33 PM
  2. Variable not defined error when I have defined the variable
    By jeffadkisson in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-27-2012, 07:00 PM
  3. Variable not defined error only on exit from Excel
    By Vindaloo in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-03-2006, 05:26 PM
  4. Replies: 3
    Last Post: 09-06-2005, 12:05 PM
  5. Replies: 0
    Last Post: 09-05-2005, 11:05 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