VBA Code For CameraTool

doofusboy

Well-known Member
Joined
Oct 14, 2003
Messages
1,325
Tried using macro recorder to get code for camera tool, but nothing recorded. Then I did a search here and found some code, but I'm getting error on highlighted line. Am I missing a reference or something? Am using Excel2007 by the way.

ERROR: Run-time error '1004':
Unable to get the Paste property of the Pictures class

Code:
    Range("A1:C9").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("M1").Select
    [B][COLOR=red]ActiveSheet.Pictures.Paste(Link:=True).Select[/COLOR][/B]

ERROR:

Run-time error '438':
Object doesn't support this property or method

If I change code to:

Code:
 Range("A1:C9").Select
Application.CutCopyMode = False
Selection.Copy
Range("M1").Select
[COLOR=red][B]ActiveSheet.Picture.Paste(Link:=True).Select[/B][/COLOR][COLOR=black]
[/COLOR]
 
Last edited:

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Try like this

Code:
Sub a()
Dim x As Object
Range("A1:C9").Copy
Range("M1").Select
Set x = ActiveSheet.Pictures.Paste(Link:=True)
End Sub
 
Upvote 0
Thanks for the quick response VoG. Tried your code and got:

Run-time error '1004':
Unable to get the Paste property of the Pictures class
 
Upvote 0
Oddly enough, I added reference and it started working. Got rid of reference and it's still working. ??? Not gonna worry since it's now working, but weird.

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,224,502
Messages
6,179,126
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top