|
-
Jul 16th, 2008, 10:28 AM
#1
Thread Starter
Frenzied Member
[Excel 2003] Progress Indicator / Status Bar
I am using this code to show progress and that the macro isn't hanging
vb Code:
'Update status bar with message
Application.StatusBar = "Splitting contents of: " & sFile
'...
'...Do stuff (potentially in a loop updating i each time)
Application.StatusBar = "Updating.." & i
'...
'...Do stuff (potentially in a loop updating i each time)
Application.StatusBar = "Loading.." & i
'...
'Give status bar back to Excel
Application.StatusBar = False
What can I do though if the majority of the work is done in one 'Split' statement at the start?
The macro would still look like it is hanging.
I sort of feel a new thread is needed to be spawned to update the StatusBar until the Split is finished.
Even if that is the way to go, I'm not sure how to do it
Any ideas?
-
Jul 16th, 2008, 01:26 PM
#2
Fanatic Member
Re: [Excel 2003] Progress Indicator / Status Bar
Making a good progress indicator is an art. Since your indicator is plain text in the statusbar, you could use a spinner at the end (/ .. - .. \ .. - .. /) updated at regular millisecond intervals.
-
Jul 16th, 2008, 04:27 PM
#3
Re: [Excel 2003] Progress Indicator / Status Bar
you could use a timer to keep updating the status bar, but you would have to create it by API, as no timer control in excel
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jul 16th, 2008, 04:48 PM
#4
Re: [Excel 2003] Progress Indicator / Status Bar
Have you tried using a DoEvent inbetween each one?
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 
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
|