ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PasteFace-Problem (https://www.excelbanter.com/excel-programming/288038-pasteface-problem.html)

Tom

PasteFace-Problem
 
Hi

I created an entry in the commandbar with a customized icon. The code is the
following:

Sub Test()
Dim cbrMenuCtrl As CommandBarButton

Worksheets("Init").Shapes(1).Copy

Set cbrMenuCtrl = Application.CommandBars("Tools").Controls.Add
With cbrMenuCtrl
.Caption = "Hello"
.OnAction = ThisWorkbook.Name & "!blabla"
.PasteFace
End With

Application.CutCopyMode = False

End Sub


The problem is that the icon remains in the Excel memory. When I enter the
paste command the icon will be pasted?!? How to free the memory?

Tom




Tom Ogilvy

PasteFace-Problem
 
Sub Test()
Dim cbrMenuCtrl As CommandBarButton

Worksheets("Init").Shapes(1).Copy

Set cbrMenuCtrl = Application.CommandBars("Tools").Controls.Add
With cbrMenuCtrl
.Caption = "Hello"
.OnAction = ThisWorkbook.Name & "!blabla"
.PasteFace
End With
ActiveCell.Copy
Application.CutCopyMode = False

End Sub

--
Regards,
Tom Ogilvy


"Tom" wrote in message
...
Hi

I created an entry in the commandbar with a customized icon. The code is

the
following:

Sub Test()
Dim cbrMenuCtrl As CommandBarButton

Worksheets("Init").Shapes(1).Copy

Set cbrMenuCtrl = Application.CommandBars("Tools").Controls.Add
With cbrMenuCtrl
.Caption = "Hello"
.OnAction = ThisWorkbook.Name & "!blabla"
.PasteFace
End With

Application.CutCopyMode = False

End Sub


The problem is that the icon remains in the Excel memory. When I enter the
paste command the icon will be pasted?!? How to free the memory?

Tom







All times are GMT +1. The time now is 12:52 PM.

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