Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screenupdating
Hello,
below is a sequence that I use to update a image(chart) on my userform. Everytime a user presses this spinbutton the updated chart is loaded on the userform. The problem I am trying to solve is that although I am using "screenupdating=false" one can see how the userform is unloaded and then reloaded. It happens in an instant but why does the screen change at all? When the userform is hidden the workbook is displayed, would hiding the workbook help here? thanks for your help, Özgür Private Sub SpinButton92_Change() Application.ScreenUpdating = False Label259.Caption = SpinButton92.Value Sheets("Org_Data").Range("B16") = SpinButton92.Value Me.Hide Call Chart End Sub Sub Chart() Application.ScreenUpdating = False Sheets("Org_Data").Select ActiveSheet.ChartObjects("Chart 25").Activate Call example End Sub Sub example() Application.ScreenUpdating = False ActiveChart.Export "temp.jpg", "JPG", True UserForm2.Show 'Application.ScreenUpdating = True On Error Resume Next Unload UserForm2 Kill "temp.jpg" On Error GoTo 0 End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screenupdating
As I understand it, which may not be correct...
Application.ScreenUpdating refers to Excel. The userform belongs to VBA. Although the 2 obviously work closely together, they are not one and the same. So whilst Excel may not be updating, VBA and your userform are. I haven't checked your code, but do you actually need the .Select/.Activate calls ? Or the userform .Hide/.Show for that matter ? Can you not just load the new graphic into Image (?) control on the userform ? NickHK "Ozgur Pars" wrote in message ... Hello, below is a sequence that I use to update a image(chart) on my userform. Everytime a user presses this spinbutton the updated chart is loaded on the userform. The problem I am trying to solve is that although I am using "screenupdating=false" one can see how the userform is unloaded and then reloaded. It happens in an instant but why does the screen change at all? When the userform is hidden the workbook is displayed, would hiding the workbook help here? thanks for your help, Özgür Private Sub SpinButton92_Change() Application.ScreenUpdating = False Label259.Caption = SpinButton92.Value Sheets("Org_Data").Range("B16") = SpinButton92.Value Me.Hide Call Chart End Sub Sub Chart() Application.ScreenUpdating = False Sheets("Org_Data").Select ActiveSheet.ChartObjects("Chart 25").Activate Call example End Sub Sub example() Application.ScreenUpdating = False ActiveChart.Export "temp.jpg", "JPG", True UserForm2.Show 'Application.ScreenUpdating = True On Error Resume Next Unload UserForm2 Kill "temp.jpg" On Error GoTo 0 End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screenupdating
Nick,
I eliminated the "select" as you suggested and it works smoothly... thanks for the pointer its definately appreciated. Regards, Özgür "NickHK" wrote: As I understand it, which may not be correct... Application.ScreenUpdating refers to Excel. The userform belongs to VBA. Although the 2 obviously work closely together, they are not one and the same. So whilst Excel may not be updating, VBA and your userform are. I haven't checked your code, but do you actually need the .Select/.Activate calls ? Or the userform .Hide/.Show for that matter ? Can you not just load the new graphic into Image (?) control on the userform ? NickHK "Ozgur Pars" wrote in message ... Hello, below is a sequence that I use to update a image(chart) on my userform. Everytime a user presses this spinbutton the updated chart is loaded on the userform. The problem I am trying to solve is that although I am using "screenupdating=false" one can see how the userform is unloaded and then reloaded. It happens in an instant but why does the screen change at all? When the userform is hidden the workbook is displayed, would hiding the workbook help here? thanks for your help, Özgür Private Sub SpinButton92_Change() Application.ScreenUpdating = False Label259.Caption = SpinButton92.Value Sheets("Org_Data").Range("B16") = SpinButton92.Value Me.Hide Call Chart End Sub Sub Chart() Application.ScreenUpdating = False Sheets("Org_Data").Select ActiveSheet.ChartObjects("Chart 25").Activate Call example End Sub Sub example() Application.ScreenUpdating = False ActiveChart.Export "temp.jpg", "JPG", True UserForm2.Show 'Application.ScreenUpdating = True On Error Resume Next Unload UserForm2 Kill "temp.jpg" On Error GoTo 0 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ScreenUpdating | Excel Programming | |||
ScreenUpdating | Excel Programming | |||
App.screenupdating | Excel Programming | |||
When to use screenupdating? | Excel Programming | |||
Screenupdating | Excel Programming |