Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running macro automatic after opening Userform
Dear all,
I have the following problem: I'd created a userform with a Image field. Now I'd like to asign a picture to that image field at the moment you open the userform. I just can't get the macro to run automatic after opening of the userform. The code: ----------------------------------------------------------------------- --------------------- Public Sub ShowPicture() Dim CurrentChart1, Fname1 Set CurrentChart1 = Sheets("Picture").ChartObjects(1).Chart Fname1 = ThisWorkbook.Path & "\temp1.gif" CurrentChart1.Export Filename:=Fname1, FilterName:="GIF" UserForm1.Show Application.run "CommandButton1_Click" End Sub ----------------------------------------------------------------------- ---------------------- Private Sub CommandButton1_Click() Path1 = "c:" Fname1 = Path1 & "\temp1.gif" Image1.Picture = LoadPicture(Fname1) End Sub ----------------------------------------------------------------------- ------------------------. When I build Commandbutton1 on the Userform and click it, the picture will show in the image field. I just like it to do it automatically when i open the Userform. Anyone a solution? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Running macro upon opening workbook | Excel Programming | |||
Automatic running of Macros | Excel Programming | |||
Automatic running of Macro for the whole spreadsheet | Excel Programming | |||
running macro at automatic time intervals | Excel Worksheet Functions | |||
Closing the Userform when macro is running | Excel Programming |