ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   inconsistent size progress bar (https://www.excelbanter.com/excel-programming/334465-inconsistent-size-progress-bar.html)

[email protected]

inconsistent size progress bar
 
hi all,

i got a macro that does chart animation and a progress bar.

i set the progressbar to be visible during animation running, updating
its status and make it invisible when the animation ends.

however everytime i re-open the document, i have to at least go to the
design mode and modify the progress bar's size otherwise the progress
bar will appear with the different size that i set (most of the times
it looks square). sometimes the positioning move to the top left corner
too.

i've tried setting the size and position manually before i made the
progressbar visible, but it didn't work. have you guys ever have
simmilar problem? (i'm using excel2002, the progress bar is on version
6.0)

this is pretty anoying since i want to locked the spreadsheet to
prevent user to tamper with it.

here's the code:
Public Sub movePoints(ByVal sourceName As String, ByVal destinationName
As String, ByVal targetName As String)
'statusbar logic
With Sheets("Form")
.pgsStatus.Value = .pgsStatus.min
.pgsStatus.Left = 51.75
.pgsStatus.Top = 480
.pgsStatus.Width = 238.5
.pgsStatus.Height = 8.25

.pgsStatus.Visible = True
.lblProgress.Visible = True
End With

For i = 1 To division

'animation logic goes here

updateProgress Sheets("Form").pgsStatus, 1, division, i
Wait 1
Next i

Sheets("Form").pgsStatus.Visible = False
Sheets("Form").lblProgress.Visible = False

end sub

Private Sub updateProgress(ByRef pgs As ProgressBar, ByVal min As
Integer, ByVal max As Integer, ByVal val As Integer)
pgs.min = min
pgs.max = max
pgs.Value = val
End Sub

kind regards

freddie



All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com