Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2014, 09:54 PM
gmayor's Avatar
gmayor gmayor is offline Create new invisible document, showing progress bar Windows 7 64bit Create new invisible document, showing progress bar Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Where are you running the macro from that creates the document?

If you run it from Word, then you are going to have an empty Word window, or the document present that you are running it from.

As for the progress indicator, you can show the form modeless and it will remain displayed while stuff happens, but you are going to have to provide updates to that display in order for the bar to change.

You can download a progress bar userform from the link, and use the following code to update it.

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub Macro1()
Dim oFrm As frmProgress
Dim PartDone As Double
Dim i As Long
Set oFrm = New frmProgress
oFrm.Show vbModeless
Application.ScreenUpdating = False
'Below is the part that reflects the updating of the form - here a simple loop
For i = 1 To 10
Sleep 1000 ' a one second delay
PartDone = i / 10


oFrm.lblProgress.Width = oFrm.fmeProgress.Width * PartDone
oFrm.Caption = "Processing item " & i & " of " & 10
DoEvents

Next i
Unload oFrm
End Sub
Reply With Quote
  #2  
Old 01-05-2017, 05:46 PM
wlcdo2 wlcdo2 is offline Create new invisible document, showing progress bar Windows 7 32bit Create new invisible document, showing progress bar Office 2013
Novice
 
Join Date: Jun 2016
Posts: 17
wlcdo2 is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
You can download a progress bar userform from the link, and use the following code to update it.
Hello Graham,
I came across your post here which was very valuable for my project. Thank you. I did try the link to download but I kept getting a 404 error. Wasn't a deal breaker for me because I managed to create a Progress Bar version based on the additional code you had also posted in the same thread. Just wondered if you knew the link wasn't working? or maybe it's at my end?

Secondly, when I call my Progress Bar to display from Document_Open, it seems to run after Word has finished loading all other attributes of the document (i.e. ActiveX Controls, Shapes & Images, etc). I've tried calling it from Document_Open located in ThisDocument and also AutoOpen from a standard Module. My document takes perhaps 10 - 15 secs to open so I was hoping to display the Progress Bar at this time; Progress Bar is updated simply based on time interval as per your example. I'm currently using Word 2016 - if that matters?

Thirdly, I had to change Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) to Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) as I'm running a 64 bit system. Is there a way to use VBA to check whether 32 or 64 bit?

I'm still reasonably new to using these forums so I hope this isn't out of line & is is OK to ask?

Kind regards, Corin.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
INCLUDEPICTURE with Mail Merge - showing same image on every document ccordner Word 0 10-23-2013 06:42 AM
Create new invisible document, showing progress bar phantom bitmaps showing on print but not in the document sour Word 1 04-08-2013 04:14 AM
How to create a progress bar AfterLife6 Excel 1 07-31-2012 08:43 PM
Object set to invisible yet I can still move its (invisible) animation paths?? seanspotatobusiness PowerPoint 0 05-23-2011 03:39 AM
Document showing up with all pictures missing? jplot Word 0 12-02-2009 06:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:45 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft