Hello Bro/Sis
Pls How to learn Vbs Macros pls send me link how to learn

Thanks My Big B/S

Nandkumar

On Wed, Jul 22, 2009 at 10:16 AM, vivek agrawal
<vivek.agrawa...@gmail.com>wrote:

> Hello,
> According to me, the error is because of the mismatch of object type and
> not that you are not able to assign onaction property to a shape object.
>
> The new_shape is of "Excel.*Shape*" type where as you are assigning to the
> new_shape - the duplicate of an Excel.*Shapes *type. While, SHAPE object
> as as *"onaction"* property where as the SHAPES object doesn't have one. I
> hope i have made myself clear.
>
>
> Thanks and Regards,
> Vivek Agrawal
> Skype ID - vivek.agrawal83
>
> GoogleMoonlight.com  - Saving energy-Save Earth
>
>
>
>
> On Wed, Jul 22, 2009 at 2:52 AM, Adrian <adrian.sitte...@gmail.com> wrote:
>
>>
>> Hello all,
>>
>> I was wondering if anyone could tell me why, when I Duplicate a Shape
>> (image), I can't assign OnAction property to it. Following is a simple
>> code that gives me "Run-time error 1004: Application-defined or object-
>> defined error":
>>
>> Sub Image1_Click()
>>    Dim new_shape As Excel.Shape
>>    Set new_shape = ThisWorkbook.Sheets("Sheet1").Shapes
>> ("Image1").Duplicate
>>    new_shape.OnAction = "exclamation"
>> End Sub
>>
>> Private Sub exclamation()
>>   MsgBox "!"
>> End Sub
>>
>> Following is xls with the code set up:
>>
>> http://groups.google.com/group/excel-macros/web/OnAction_problem.xls?hl=en
>>
>> I also noticed that when I create a new Shape in VBA, then I can
>> assign OnAction to it. However, since creating a new image requires
>> thea path of the image on the local drive, I want to duplicate it from
>> the spreadsheet instead.
>>
>> Thank you in advance,
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 5,000 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to