userform

VBA UserForm Object

Hi, I'm really struggling with something here. I have a class module, let's call it FormMan which has a bunch of methods relating to the large number of userforms I have in my project. One particular method is to be called from a lot of different places and is pretty simple - it simply adds a user defined number of controls to a form and...

Assign on-click VBA function to a dynamically created button on Excel Userform

I'm creating buttons dynamically on an Excel userform with the following code: With Me.CurrentFrame.Controls.Add("Forms.CommandButton.1") .Caption = "XYZ" .name = "AButton" .Font.Bold = True .ForeColor = &HFF& ... blah blah blah End With I'd like to assign a function to run when these buttons are clicked, but I can...

Possible to send message to excel userfom control

As I understand it, excel userform controls are windowless (at least majority of them). Due to this fact, would it be possible to update an excel userform using win32 ? ...

Assigning hotkeys to buttons on forms created for excel vba

Hello, I have created a macro for excel which will pop up form that contains button and text field. Is there a way to assign hotkeys such as 'ctrl+Enter' or 'F12' to the buttons? The hotkey should work regardless of which field or button the focus is on. (so far I have managed to create buttons/fields_Keydowns to check MSForms.ReturnIn...

Timer on user form in Excel VBA

I've got some old Excel VBA code where I want to run a task at regular intervals. If I were using VB6, I would have used a timer control. I found the Application.OnTime() method, and it works well for code that's running in an Excel worksheet, but I can't make it work in a user form. The method never gets called. How can I make Applica...

VBA UserForm Array

Currently, I have an Excel spreadsheet with some data and a command button that creates a UserForm that displays a subset of that data. The UserForm has been designed in a way that makes the data easier to view. The problem that I'm having is that I would like the command button to make multiple instances of my UserForm so that each form...

Why does Showing a UserForm as Modal Stop Code Execution?

The following VBA code stops at Me.Show. From my tests, it seems that Me.Show stops all code execution, even if the code is inside the UserForm. This part is outside the UserForm: Public Sub TestProgress() Dim objProgress As New UserForm1 objProgress.ShowProgress Unload objProgress End Sub This part is inside the UserFo...

Can't close userform

Let me set up the environment. This is VBA code running in Excel. I have a userform that contains a mxflexgrid. This flexgrid shows a list of customers and the customer', salesperson, csr, mfg rep, and territories, assignments. When you click in a column, let's say under the Territory column, another userform opens to show a list of T...

Pause Events in Excel VBA

I have an application written in VBA for Excel that takes in a live data feed. Whenever there is a change in the data, various events are triggered within VBA. I also have some UserForms with ComboBoxes on them. My problem is that when I click the down arrow on the ComboBox and try to make a selection, the moment I get an update from th...

Userform Cancel Button _Intermittently_ Unresponsive?

The attached VBA procedures are for a progress bar userform. Everything works as expected, except that the cancel button is intermittently unresponsive. I say intermittently because, 95% of the time I have to click the cancel button numerous times before the procedure stops. I can see the button click event being animated, but the proce...

Is it better to show ProgressBar UserForms in VBA as modal or modeless?

Is it better to show ProgressBar UserForms in VBA as modal or modeless? What are the best practices for developing progress indicators in VBA? Modeless UserForms require the use of Application.Interactive = False, whereas Modal UserForms by their very nature block any interaction with the application until the core procedure has finishe...

Windows Forms' Appearance

Just started using Visual Studio 2008 and was hoping to convert my VBA UserForms to VB.NET with the intent of upgrading my antiquated UserForm controls to newer Windows form controls that match the operating system. The Windows forms I create in Visual Studio look great, but when I load them in PowerPoint or Excel, the form controls loo...

VBA How do you copy and paste in a Userform using right-click?

I want to allow users to be able to paste values into TextBoxes in a userForm in VBA. You can use Ctrl-v just fine, but not everyone knows how to do that. How do I enable copy and pasting using a right-click menu? ...

Can't read the value of a button click from a userform

I hope this is a relatively easy problem although I have spent hours websearching and using T&E to no avail. Hopefully someone can help ;o) I have an excel module that shows a UserForm to get some input data before doing a lot of processing. At the bottom of the userform are a couple of command buttons labeled "OK" and Cancel". I nee...

How to change the title bar text of a Userform in VBA?

I'm maintaining an old-ish application written in VBA for Excel 2002 (XP)/2003, and am trying to internationalise it. To do this, I read in the translated strings dynamically and update the various controls on my userform by updating their .Caption property. This works as expected for all controls but not for the form itself -- when I ...

VBA Textbox loses focus on 'Alt-Gr'

Hi, I am experiencing a funny behaviour of Textboxes on a VBA Userform: On pressing Alt-Gr the box loses focus. This happens after running a bit of VBA initialization code for the form. The text box has neither initialization code nor event listeners. Starting the user form straight out of the IDE everything is fine. I suspect a MS Off...