|
-
Apr 3rd, 2004, 01:55 PM
#1
Thread Starter
Lively Member
Excel 97 Screen Refresh (Resolved)
Anyone have a bit of code that I can use to force a screen refresh using VBA in Excel 97.
I know of the ScreenUpdating = true property, but I think I am looking more for a ScreenUpating = NOW property.
I ran accross a reference to a ScreenRefresh method in "Excel 2002 VBA" by Wrox Prex, but they just hint at it and never give an example or actual setup for it. I can't find it in the application model for 2002 or 97.
ScreenUpdating works to show commands as they happen. I want to refresh the screen -after- all the fun stuff has happened. Kind of like sending a wakeup call to the system to show the current status at that point in time.
Last edited by TheFIDDLER; May 14th, 2004 at 09:09 PM.
-----
#VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP
I miss my VIC 20.
Never should have upgraded to my commodore 64. ...
-
Apr 3rd, 2004, 02:41 PM
#2
What about the basic DoEvents method? It doesn't work for your situation?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 3rd, 2004, 03:54 PM
#3
Thread Starter
Lively Member
Just tried it. Nope.
I am using a VBA form in a workbook that has many calculations, and my code hides/unhides collumns as required. For which it really slows down code if this is done with screenupdating set to true.
On the same form, I have a combobox where the user can select a category of items to view. Clicking the box doesn't really do anything. I use the listvalue when the user clicks a command button to actually do something with it.
Bad part is that with screenupdating set to false, my combobox does not redraw the part of the screen which it used to display the data.
And where this is really inert - there is no active event to redraw, screenupdate doesn't work for me. I tried screenupdating as part of the combobox change event, but a) nothing happens b) if I set it to true then I have no second chance to reset it to false.
I tried a set screenupdating to true, followed by a Doevents, followed by a set screenupdating to false in the combobox change event and still got nothing.
Which brings me back to my original request for some type of screen refresh command...
-----
#VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP
I miss my VIC 20.
Never should have upgraded to my commodore 64. ...
-
Apr 3rd, 2004, 04:41 PM
#4
Try the combo box click or keyup event instead. The change
event is when a list item is actually changed or if the style is 0 or
1 and the user types something into it.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 3rd, 2004, 07:25 PM
#5
Thread Starter
Lively Member
The click event can at least turn screen updating on.
Still only half the battle.
I need it to turn screen updating on, update, and then turn screen updating off. And if I turn it on, doevents, and turn it off, nothing happens. So I can only use it as an on switch.
Actually, I figured out a way around this - but it reaks of bad coding. Since my click event for the combobox can be used to set screen update to true, and I need this whenever someone changes a value in the combobox, I can add the line for screen updating = false, to the start of each subroutine that is callable from within the form. Thus technically, being off before any formulas are recalculated or any collumns are hidden.
-----
#VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP
I miss my VIC 20.
Never should have upgraded to my commodore 64. ...
-
Apr 3rd, 2004, 09:50 PM
#6
I can't find it in the application model for 2002 or 97.
It is not in 2003 either. I even searched M$ Office On-Line - Nothing.
Must be a custom written function that the author is referring to.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 3rd, 2004, 11:30 PM
#7
Thread Starter
Lively Member
Yeah
I double check my book - author is detailing the application object and the following is listed:
"Screenupdating - boolean - Set/Get whether Excel updates its display while a procedure is running. This property can be used to speed up procedure code by turning off screen updates during processing. Use with the ScreenRefresh method to manually refresh the screen." - from "Excel 2002 VBA"
Except I doubt the ScreenRefresh method actually exists since I can't find any other references to it.
-----
#VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP
I miss my VIC 20.
Never should have upgraded to my commodore 64. ...
-
Apr 3rd, 2004, 11:56 PM
#8
Maybe its a typo or something because if you can't find it in 2002
or 97 and I can't find it in 2003 then perhaps you can contact the
author and get him to elaborate on this situation?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 12th, 2004, 08:04 PM
#9
Lively Member
wat bout Application.Refresh/Application.RefreshAll or somethin..
(im new)
"Through every dark night there's a brighter day, so no matter how hard it get, put your chest out and keep your head up, and handle it"
-
Apr 12th, 2004, 08:19 PM
#10
There is no Application.Refresh or .RefreshAll
It is only in the Workbook object and it doesn't do screen refreshing.
From the help file...
RefreshAll Method
Refreshes all external data ranges and PivotTable reports in the specified workbook
Refresh
Refreshes a Chart, PivotTable, ListObject, QueryType, or
XMLDataBinding object's datasource and does not commit
changes in the object.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 12th, 2004, 08:24 PM
#11
Lively Member
Originally posted by RobDog888
There is no Application.Refresh or .RefreshAll
It is only in the Workbook object and it doesn't do screen refreshing.
From the help file...
RefreshAll Method
Refreshes all external data ranges and PivotTable reports in the specified workbook
Refresh
Refreshes a Chart, PivotTable, ListObject, QueryType, or
XMLDataBinding object's datasource and does not commit
changes in the object.
ive acknowledged that!
"Through every dark night there's a brighter day, so no matter how hard it get, put your chest out and keep your head up, and handle it"
-
May 10th, 2004, 09:11 PM
#12
Fanatic Member
Use the Me.Repaint method.
from the help:
The Repaint method is useful if the contents or appearance of an object changes significantly, and you don't want to wait until the system automatically repaints the area.
-
May 14th, 2004, 09:08 PM
#13
Thread Starter
Lively Member
Me.Repaint
Me.verythankfull !
Thank you! This will come in very handy at many places within my code. This is actually exactly what I had been looking for. Excel is notorious for not redrawing once memory consumption increases.
-----
#VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP
I miss my VIC 20.
Never should have upgraded to my commodore 64. ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|