LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 103
Default AdvancedCommandBars

Question is why (IsEmptyWorksheet) can hang up the running of the application
does this statement need a Dim
This statement produces all the system faces and takes 3 minutes to run.

Dim iFaceId As Integer ' Tracks Current FaceID
Dim iColumn As Integer ' Tracks Current column in worksheet
Dim iRow As Integer ' Tracks current Row in worksheet
Dim ctl As CommandBarControl
Dim cbr As CommandBar
If Not IsEmptyWorksheet(ActiveSheet) Then Exit Sub
On Error GoTo Recover
Application.ScreenUpdating = False
Set cbr = CommandBars.Add(Position:=msoBarFloating, MenuBar:=False,
temporary:=True)
Set ctl = cbr.Controls.Add(Type:=msoControlButton, temporary:=True)
iRow = 1
Do
For iColumn = 1 To 10
iFaceId = iFaceId + 1
Application.StatusBar = "FaceID = " & iFaceId
ctl.FaceId = iFaceId
ctl.CopyFace
ActiveSheet.Paste Cells(iRow, iColumn + 1)
Cells(iRow, iColumn).Value = iFaceId
Next iColumn
iRow = iRow + 1
Loop
Recover:
If Err.Number = 1004 Then Resume Next
Application.StatusBar = False
cbr.Delete



End Sub

--
William<"M"


 
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



All times are GMT +1. The time now is 07:11 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"