none
Vba within created user form works fine in testing within vba editor but not from toolbar RRS feed

  • Question

  • I have a user form designed with a number of different Command buttons on it. I have been setting up the code and testing it by running it using the Run Sub/user form button on the Vb editor toolbar and everything has been working fine.  The bottom half of the user form contains a number of different user text boxes and command buttons for Program initial setup options for the user and ways for them to see sample views of the changes the user makes.  This bottom half is initially not Visible and the top half has a Command button to "Show Setup options" which increases the presently 1/2 size form to it's full size so that the setup options can be accessed. The form has code within the Form "Initialize" event that opens an ini file and reads saved setup data, and fills the textboxes within the setup options portion of the form.  Everything on this form works fine in testing from within the vb Editor.

    I just now created a toolbar button and a macro to load the Form, (attempting to simulate the user process) which works fine, the 1/2 size form shows up but neither the Close form button on the form nor the button to display the bottom of the form and the setup options work properly.  Interestingly, when the 'Show Setup Options" button is clicked - the caption on the button correctly changes but the code to resize the form does not work.  Also the "Instructions" Command button which uses Shell to launch Notepad with the instructions file works fine.

    This is my first dealing with VBA in Outlook.  I have done probably 7-8 small size projects with VBA in Excel and Access before and never ran into anything like this.  Do you know what I am missing here?
    Sunday, March 24, 2013 7:22 AM

Answers

  • It's impossible to say what's going on from just a description like that. Have you tried any debugging on what's going on?
     
    If you set breakpoints in your button handler code you can see if those breakpoints are being hit and then what's going on inside the click handlers.
     
    You can also set MsgBox lines in your code to mark hitting specific points in the code, and by commenting out or setting breakpoints in error handlers you can see if any errors are being fired.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "TeeTho" <=?utf-8?B?VGVlVGhv?=> wrote in message news:2f4a6bda-0ffe-4657-8561-fffac1ca9f61...
    I have a user form designed with a number of different Command buttons on it. I have been setting up the code and testing it by running it using the Run Sub/user form button on the Vb editor toolbar and everything has been working fine.  The bottom half of the user form contains a number of different user text boxes and command buttons for Program initial setup options for the user and ways for them to see sample views of the changes the user makes.  This bottom half is initially not Visible and the top half has a Command button to "Show Setup options" which increases the presently 1/2 size form to it's full size so that the setup options can be accessed. The form has code within the Form "Initialize" event that opens an ini file and reads saved setup data, and fills the textboxes within the setup options portion of the form.  Everything on this form works fine in testing from within the vb Editor.

    I just now created a toolbar button and a macro to load the Form, (attempting to simulate the user process) which works fine, the 1/2 size form shows up but neither the Close form button on the form nor the button to display the bottom of the form and the setup options work properly.  Interestingly, when the 'Show Setup Options" button is clicked - the caption on the button correctly changes but the code to resize the form does not work.  Also the "Instructions" Command button which uses Shell to launch Notepad with the instructions file works fine.

    This is my first dealing with VBA in Outlook.  I have done probably 7-8 small size projects with VBA in Excel and Access before and never ran into anything like this.  Do you know what I am missing here?

    Ken Slovak MVP - Outlook
    Monday, March 25, 2013 2:20 PM
    Moderator