View Single Post
 
Old 08-11-2014, 09:54 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit 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