Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ScreenUpdating Steven Excel Programming 5 May 1st 06 08:42 PM
ScreenUpdating Paul Excel Programming 2 March 8th 06 10:16 PM
App.screenupdating Steph[_3_] Excel Programming 2 May 11th 05 10:39 PM
When to use screenupdating? augustus Excel Programming 2 December 12th 04 09:21 PM
Screenupdating Fu Manchu Excel Programming 2 January 11th 04 02:08 PM


All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"