pasting into embedded excel object

M

mike

Sorry if this is a double post, but I don't think the first time worked...
Anyway, I need to paste into a specific cell of an embedded excel object,
but I can't get it to work. The paste works, but it pastes into the last
selected cell. My code is:

Sub PasteExcel()
Dim xlSheet As Excel.Worksheet
Set xlSheet = ActivePage.Shapes("excel").Object.Worksheets(1)

'Either of these next statements give me an error
'xlSheet.Activate
'xlSheet.Range("E2").Select

xlSheet.Paste
End Sub
 
N

Nikolay Belyh

I think this should work:

Sub PasteExcel()
Dim xlSheet As Excel.Worksheet
Set xlSheet = ActivePage.Shapes("excel").Object.Worksheets(1)

xlSheet.Paste xlSheet.Range("E2")

Kind regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top