Forum Discussion
ryanbarton324
Apr 26, 2021Copper Contributor
Running VBA code after clicking on a UserForm 'image'
Hello, I am currently trying to write some VBA code that will initialize once I left click on a UserForm image I have uploaded. In my specific situation, I am using a hovering effect for a 'Login...
- Apr 28, 2021
There is a textbox named TextBox1 on top of the Password text box.
So you actually enter the password in TextBox1, and the Password text box remains empty. Hence the message that the login information is incorrect.
Andrey_Kuzmin
Aug 05, 2022Copper Contributor
I am not sure of if this thread is actual, however, it looks like Image control has _Click event, despite it doesn't present in the VBA list.
If you type directly:
Private Sub Image1_click()
Excel will call that procedure on clicking the image area.
I have written an add-in for Excel 2003 for getting points from scientific graphic files.
It works well in Excel 2021.
Sincerely,
Andrey
JonPeltier
Aug 05, 2022MVP
As I stated, the Click event dows not appear in the events dropdown of the UserForm code module when an image is selected in the Objects dropdown, but if you open the Object Browser, scroll to Image in the list of classes, right click on the list of members, and choose Show Hidden Members, you will see a gray entry for Click. This means you can write your own _Click event procedure from scratch.
- Andrey_KuzminAug 07, 2022Copper ContributorExcellent,
Thank you JonPeltier