Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA Progress bar on a userform

Is it possible to implement a progress bar on a userform in Excel?

I don't find any info about progress bars in the Help or Manuals

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Excel VBA Progress bar on a userform

Hi,

I have an example with a few variations.
http://www.andypope.info/vba/pmeter.htm

as does John Walkenbach.
http://j-walk.com/ss/excel/tips/tip34.htm

Cheers
Andy

Bo_ < wrote:

Is it possible to implement a progress bar on a userform in Excel?

I don't find any info about progress bars in the Help or Manuals.


---
Message posted from http://www.ExcelForum.com/


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Excel VBA Progress bar on a userform

You could also try using a modeless form in XL2000 or above, as in this
approach:

http://www.enhanceddatasystems.com/E...rogressBar.htm

Robin Hammond
www.enhanceddatasystems.com

"Bo_ " wrote in message
...
Is it possible to implement a progress bar on a userform in Excel?

I don't find any info about progress bars in the Help or Manuals.


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Excel VBA Progress bar on a userform

Hi Bo_,
a possibility with API:
In UserForm module:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function CreateWindowEX Lib "user32" _
Alias "CreateWindowExA" (ByVal dwExStyle As Long, _
ByVal lpClassName As String, ByVal lpWindowName As String, _
ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, _
ByVal nWidth As Long, ByVal nHeight As Long, _
ByVal hWndParent As Long, ByVal hMenu As Long, _
ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" _
(ByVal hwnd As Long) As Long
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long

Private Sub CommandButton1_Click()
Me.CommandButton1.Enabled = False
Me.Repaint
Dim y&, W&, mehWnd&, pbhWnd&, i&
mehWnd = FindWindow(vbNullString, Me.Caption)
W = Me.InsideWidth * 4 / 3
y = (Me.InsideHeight - 15) * 4 / 3
pbhWnd = CreateWindowEX(0, "msctls_progress32", "" _
, &H50000000, 0, y, W, 20, mehWnd, 0&, 0, 0&)
SendMessage pbhWnd, &H409, 0, ByVal RGB(0, 125, 0)
For i = 1 To 50000
DoEvents
SendMessage pbhWnd, &H402, CInt(100 * i / 50000), 0
Next i
DestroyWindow pbhWnd
Me.CommandButton1.Enabled = True
End Sub

Regards,
MP

"Bo_ " a écrit dans le message de
...
Is it possible to implement a progress bar on a userform in Excel?

I don't find any info about progress bars in the Help or Manuals.


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel progress bar MeTheITGuy Charts and Charting in Excel 5 March 28th 07 10:51 PM
How to make Ms Excel more Excel with Command Button and progress b immu Excel Discussion (Misc queries) 2 January 6th 07 09:14 AM
Excel and Progress Fred Smith Excel Programming 3 April 28th 04 05:23 PM
UserForm as Progress Indicator MWE Excel Programming 6 January 19th 04 03:22 PM
Displaying progress on UserForm Nigel Stevens Excel Programming 1 July 9th 03 01:55 PM


All times are GMT +1. The time now is 03:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"