Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default Method 'PasteFace' of objetc 'CommandBarButton' failed

I need help, please!

I have a add-in named "IDini.xla" with a "CreateIDNavigator" macro wich make
a custom command bar. The file "IDini.xla" have a worksheet named "Icons"
with some drawing objects where using the commnad "copy" and after
"PasteFace" in command bar.

I did the following:

Sub CreateIDNavigator()
Dim myControl1

For Each bar In Application.CommandBars
If Not bar.BuiltIn And bar.Name = "IDNavigator" Then bar.Delete
Next

Set myBar1 = CommandBars.Add(Name:="IDNavigator", _
Position:=msoBarFloating)
myBar1.Visible = False

Set myControl1 = myBar1.Controls.Add(Type:=msoControlButton, ID:=1)
With myControl1
.Style = msoButtonIcon
.Caption = "Registrar"
.OnAction = "AppRegister"
.Tag = "Register"
End With
Workbooks("IDini.xla").Worksheets("Icons").Drawing Objects(33).Copy
myControl1.PasteFace

myBar1.Visible = True

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Method 'PasteFace' of objetc 'CommandBarButton' failed

If the drawing object isn't a bitmap, the copy format is not compatible with
a button. Try CopyPicture using OnScreen and Bitmap options (record a macro
to help with syntax).

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"Dennis" wrote in message
...
I need help, please!

I have a add-in named "IDini.xla" with a "CreateIDNavigator" macro wich
make
a custom command bar. The file "IDini.xla" have a worksheet named "Icons"
with some drawing objects where using the commnad "copy" and after
"PasteFace" in command bar.

I did the following:

Sub CreateIDNavigator()
Dim myControl1

For Each bar In Application.CommandBars
If Not bar.BuiltIn And bar.Name = "IDNavigator" Then bar.Delete
Next

Set myBar1 = CommandBars.Add(Name:="IDNavigator", _
Position:=msoBarFloating)
myBar1.Visible = False

Set myControl1 = myBar1.Controls.Add(Type:=msoControlButton, ID:=1)
With myControl1
.Style = msoButtonIcon
.Caption = "Registrar"
.OnAction = "AppRegister"
.Tag = "Register"
End With
Workbooks("IDini.xla").Worksheets("Icons").Drawing Objects(33).Copy
myControl1.PasteFace

myBar1.Visible = True

End Sub



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
range method failed davegb Excel Programming 2 November 15th 05 04:55 PM
Copy method failed Daniel Bonallack Excel Programming 2 October 14th 05 05:24 AM
method range failed davegb Excel Programming 6 September 14th 05 08:19 PM
Calculation Method Failed Martiin Excel Programming 2 December 1st 03 01:37 PM
Method ~ of Object ~ Failed. Joan Excel Programming 5 August 26th 03 08:13 PM


All times are GMT +1. The time now is 11:45 PM.

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

About Us

"It's about Microsoft Excel"