Excel macro runtime error 438

prithviravi

New Member
Joined
Apr 7, 2014
Messages
1
I'm making a macro for a computing assigment for excel. When i run the macro i get the error 'Run-Time Error 438 - Object doesn't support this property or methord' This is in relation to the picture which i have to include in the assigment. I created a new worksheet tab and put the picture there, i started recording the macro and then copied and pasted the picture into a new worksheet tab where i made my macro. This is my VBA:

Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Sheets("Sheet2").Select
Selection.Copy
Sheets("Sheet3").Select
ActiveSheet.Paste
Selection.ShapeRange.IncrementLeft 58.8
Selection.ShapeRange.IncrementTop 6
ActiveCell.Offset(14, 1).Range("A1").Select

The bolded area is my problem, how do i fix it?

Thanks all
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Excel can only have 1 Selection. Your code is moving it to Sheet2 and therefore losing it from the picture.
Do the Copy first so the picture is in the clipboard before moving to Sheet2.
 
Upvote 0
I get the same error. If I read your post correctly Copying and pasting is giving me the error?

Here's my code:

Sub MacroTest2()
'
' MacroTest2 Macro
' Send e-mails
'
' Keyboard Shortcut: Ctrl+e
'
Range("A1").Select
ActiveSheet.Next.Select
Selection.Copy
Selection.ShapeRange.Item(1).Hyperlink.Follow NewWindow:=False, AddHistory _
:=True
ActiveSheet.Next.Select
Application.CutCopyMode = False
Selection.Copy
Selection.ShapeRange.Item(1).Hyperlink.Follow NewWindow:=False, AddHistory _
:=True
ActiveSheet.Next.Select
Application.CutCopyMode = False
Selection.Copy
Selection.ShapeRange.Item(1).Hyperlink.Follow NewWindow:=False, AddHistory _
:=True
Sheets("Sheet1").Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

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