PDA

View Full Version : Copy textbox from Excel to Powerpoint



kevinkw80
06-15-2011, 06:14 AM
Hi - First Posting.

I am trying to copy a series of textboxes that have been layed out in Excel and paste into Powerpoint at predefined locations. These are textboxes that are created as "Insert-Textbox" rather than from the toolbox. Is this possible?

Thank you,

Kenneth Hobs
06-15-2011, 10:38 AM
Welcome to the forum. This might help get you started. Since you don't have 5 posts yet, you can not attach files. Those would help us help more.

Dim s As Shape
For Each s In ActiveSheet.Shapes
Debug.Print TypeName(s), s.AutoShapeType, s.Type 'type 17=Insert > Text Box
Next s

kevinkw80
06-23-2011, 10:42 AM
Thank you for your help. I just got around to inserting this into the file. This is how far I have gotten. I understand that in order to copy a text box, we must know its name within the application. The following script will rename each textbox, but now I am at the point where I am looking for a way to select each textbox, copy it, and paste it into Powerpoint in exactly the same location. Any further help is very much appreciated.

Dim TB As textbox
Dim wks As Worksheet
Dim iCtr As Long
Dim x As Long
Worksheets("AutoFill Whiteboard").Range("Y1:Y43").Select
Selection.ClearContents
For Each wks In ActiveWorkbook.Worksheets
iCtr = 1
x = 1
For Each TB In wks.TextBoxes
TB.Name = "TB" & iCtr
ActiveSheet.Range("Y" & x) = iCtr
iCtr = iCtr + 1
x = x + 1
Next TB
Next wks

Kenneth Hobs
06-23-2011, 11:46 AM
Please use vba code tags when posting vba code.

If you would make a simple xlsm and pptx or pptm file and a possible resultant ppt file, zip and attach, it would make it easier to help.

It is not clear what you want to happen. Put the textboxes into one slide, more than one, in the active ppt file, create a ppt file, open a ppt file and insert in what slide(s), and so on?

Obviously the location in the Spreadsheet can not govern fully as the size is much larger than what a slide can present.