|
-
Jun 6th, 2007, 09:35 AM
#1
Thread Starter
Junior Member
Can't paste in an Excel object?
I'm trying to paste something in an Excel Object placed in a Powerpoint presentation.
The first line, which activates the edit mode for the object works fine, but I can't seem to paste, it gives me an error saying "This object does not support this method or property".
Code:
ActivePresentation.Slides(4).Shapes("Object 10").OLEFormat.DoVerb 1
ActivePresentation.Slides(4).Shapes("Object 10").OLEFormat.Object.Worksheets("data").Range("c4").Paste
Any ideas?
-
Jun 6th, 2007, 09:39 AM
#2
Re: Can't paste in an Excel object?
Open an instance of the actual Excel file...
Dim M_Excel as Object
Dim Wb as Object
Set M_Excel = CreatObject("Excel.Application",)
Set Wb = M_Excel.WEorkbooks.Open("YourFile.xls")
And alter whatever you want....
The alturations should be reflected in the presentation on saving the fgile again.
 why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
for every question you ask provide an answer on another thread.
-
Jun 6th, 2007, 10:24 AM
#3
Thread Starter
Junior Member
Re: Can't paste in an Excel object?
 Originally Posted by Dnereb
Open an instance of the actual Excel file...
Dim M_Excel as Object
Dim Wb as Object
Set M_Excel = CreatObject("Excel.Application",)
Set Wb = M_Excel.WEorkbooks.Open("YourFile.xls")
And alter whatever you want....
The alturations should be reflected in the presentation on saving the fgile again.
It's not an actual excel file, it's just an excel chart object.
-
Jun 6th, 2007, 11:28 AM
#4
Fanatic Member
Re: Can't paste in an Excel object?
Don't paste, just assign the value you want:
Code:
With ActivePresentation.Slides(4).Shapes("Object 10").OLEFormat
.DoVerb 1
.Object.Worksheets("data").Range("c4") = whatever
End With
-
Jun 6th, 2007, 11:41 AM
#5
Thread Starter
Junior Member
Re: Can't paste in an Excel object?
 Originally Posted by VBAhack
Don't paste, just assign the value you want:
Code:
With ActivePresentation.Slides(4).Shapes("Object 10").OLEFormat
.DoVerb 1
.Object.Worksheets("data").Range("c4") = whatever
End With
What if I need to paste? How can I do it?
Further down the code I have to copy this Range("A5:G14") and to do it all one by one would take a lot of time...
Last edited by matomato; Jun 6th, 2007 at 12:34 PM.
-
Jun 6th, 2007, 12:38 PM
#6
Fanatic Member
Re: Can't paste in an Excel object?
I never use paste. You can assign even if multiple cells:
vb Code:
With ActivePresentation.Slides(1).Shapes("Object 4").OLEFormat.Object.Worksheets("Sheet1")
' 'single cell - .Value optional
.Range("C1") = .Range("A6")
' 'multiple cells - need .Value
.Range("C3:D14") = .Range("A3:B14").Value
End With
Last edited by VBAhack; Jun 6th, 2007 at 01:03 PM.
-
Jun 6th, 2007, 03:39 PM
#7
Thread Starter
Junior Member
Re: Can't paste in an Excel object?
 Originally Posted by VBAhack
I never use paste. You can assign even if multiple cells:
vb Code:
With ActivePresentation.Slides(1).Shapes("Object 4").OLEFormat.Object.Worksheets("Sheet1")
' 'single cell - .Value optional
.Range("C1") = .Range("A6")
' 'multiple cells - need .Value
.Range("C3:D14") = .Range("A3:B14").Value
End With

Thanks, I didn't know you could do that.
I tried your first solution since it's easier for me because I don't want to check every destination for the complete range.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|