Y
Yarroll
Hi,
What would be the best way to set up an Excel personal toolbar so that it
doesn't eat lots of memory?
My Excel eats a lot of memory. I noticed this problem occurs especially when
running macros in workbooks with customized toolbars, with frequent "out of
memory" messages when trying to open VBE. No idea if this is caused by the
toolbar though. I use the following macro to create a toolbar on open and
close on exit:
Private Sub Workbook_Open()
Dim oCB As CommandBar
Dim oCtl As CommandBarButton
Set oCB = Application.CommandBars.Add(Name:="My Macros",
temporary:=True)
With oCB
Set oCtl = .Controls.Add
With oCtl
.Style = msoButtonIcon
.FaceId = 59
.OnAction = "MyStuff1"
.TooltipText = "MyStuff1"
End With
Set oCtl = Nothing
' (and it goes on for some more controls, no more than 15; FaceIds are
standard Excel icons)
Would there be a simpler way to build a toolbar? Or is the above likely to
run into memory problems?
What would be the best way to set up an Excel personal toolbar so that it
doesn't eat lots of memory?
My Excel eats a lot of memory. I noticed this problem occurs especially when
running macros in workbooks with customized toolbars, with frequent "out of
memory" messages when trying to open VBE. No idea if this is caused by the
toolbar though. I use the following macro to create a toolbar on open and
close on exit:
Private Sub Workbook_Open()
Dim oCB As CommandBar
Dim oCtl As CommandBarButton
Set oCB = Application.CommandBars.Add(Name:="My Macros",
temporary:=True)
With oCB
Set oCtl = .Controls.Add
With oCtl
.Style = msoButtonIcon
.FaceId = 59
.OnAction = "MyStuff1"
.TooltipText = "MyStuff1"
End With
Set oCtl = Nothing
' (and it goes on for some more controls, no more than 15; FaceIds are
standard Excel icons)
Would there be a simpler way to build a toolbar? Or is the above likely to
run into memory problems?