PP VBA

  • Thread starter Thread starter jonathan
  • Start date Start date
J

jonathan

Does anyone know how to access a cell from Excel and
translate the contents of that cell to text/String?
i.e. if Cell B1 contains "Apple", how can you get the
String "Apple" from Cell B1 after you pasted it in PP.

the snippet is something like this:
Set slide3Table = wbDownload.Sheets("CODC")

slide3Table.Range("C49").CopyPicture
/* I need to know what text/string is in C49 */

Dim slide3 As Slide

Set slide3 = ActivePresentation.Slides("CODC")

Call pastePPTShape(slide3, "Title", 215.88, 4, 38.88,
287.88)
MsgBox "The import completed successfully"
 
Jonathan,
Get a reference to the Excel Workbook and then proceed.

' -----------------------------------
Dim XLObj As Excel.Workbook
Dim oShape as PowerPoint.Shape

Set oShape = ActiveWindow.Selection.ShapeRange(1)
' Assumes that the selected shape is an excel object.

Set XLObj = oShape.OLEFormat.Object
Msgbox XLObj.Worksheets(1).Range("A1")
' Clean up
' -----------------------------------
 
Thanks Shyam!
I'm new to VBA but I think I got something from your reply
that would help me do the task.

I got another question, I have this 1 PP file and several
XLS files. I need to get some details or a list from these
XLS files and put them in my PP file. I can only reach a
maximum of 5 items to show on my PP file.
I don't have any idea yet how to open several xls files and
copy the content to PP. The files doesnt have to be opened
at the same time. The problem I'm seeing it how could I
make sure that it lists the items correctly on the PP file.
ie.
PP XLS 1 contains B, C
1. B XLS 2 contains E
2. C XLS 3 contains D, F
3. E XLS 4 contains A
4. D * XLS are arranged in what files were
5. F opened first
 
Back
Top