![]() ![]() ![]() Just inspire yourself with what is there and make it suit your specific needs. Customizationsįeel free to make it your own! You now have a solid base illustrating how it is done, but you can add more features as you see fit. That said, the functions are there for those others time when you wish to override the default values. One quick comment, instead of always using function to change the look and feel of the progress bar, don’t forget that you can also simply edit the form, change the colors, alignment, fonts, … to make the default what you want. This only uses basic VBA functions, uses no references, nor any ActiveX controls and is bitness independent (so it will run equally on 32 or 64-bit installations). Or a more complex example with configurations applied would look like: Sub GenericTest1()Ĭls_ProgressBar.ProgressBar_ProgressOverlay True 'OptionalĬls_ProgressBar.ProgressBar_Resize 150, 325 'Optional Resize the formĬls_ProgressBar.ProgressBar_Color RGB(253, 109, 13) 'Change progress bar color - OrangeĬls_ProgressBar.ProgressBar_Caption "Export Progress"Ĭls_ProgressBar.ProgressBar_Message1 "Exporting data to Excel." & vbCrLf & vbCrLf & "Enjoy!"Ĭls_ProgressBar.ProgressBar_Message1_FontParam Align_Left, "Calibri", Weight_Normal, 8, RGB(0, 102, 204)Ĭls_ProgressBar.ProgressBar_Message2_Align Align_CenterĬls_ProgressBar.ProgressBar_ProgressValue_Align Align_CenterĬls_ProgressBar.ProgressBar_Hide 'Automatically close the ProgressBar Sleep 25 'Just for demonstration purposes!Ĭls_ProgressBar.ProgressBar_Message2 "Operation Completed Successfully!" ![]() However, at it’s simplest we could use it by doing: Sub GenericTest1()Ĭls_ProgressBar.ProgressBar_Message2 "Iteration " & Chr(10) & iĬls_ProgressBar.ProgressBar_Progress (i / lNoIteration) I’m not going to post the code here, for that simply download and review the demo file provided below. Then I decided I wanted to be able to change the fonts: size, weight, color, family, alignment, …, resize the progress bar at runtime.Īnyways, with a little VBA code we end up being able to generate things like: Then I added so labels to be able to communicate to the user what exactly was going on, which step in the process was happening. Per the usual, I started off with a very basic progress bar and it has evolved over time as I’ve added new features/capabilities to make it more adaptive.Īt it’s core, it is a simple form with a background rectangle and a superimposed textbox that we make the width of grow as the process evolves. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |