PDA

View Full Version : VBA macro to recurse images in powerpoint pres & copy to column cells in excel



silvanet
12-06-2016, 12:53 PM
I see plenty of questions going the other way - copying cell contents in excel to powerpoint presentation slides, but what I want to do is the reverse.

I have 57 pages of images with descriptions in a pdf file I tried to export to excel but could not do it cleanly.

I figured how to export the pdf images and descriptions cleanly into a powerpoint presentation.

Now I'd like to create a VBA macro to go through the powerpoint presentation, find, copy, and then paste the images to cells in succession in a column on my spreadsheet.

I was able to export the full list of descriptions cleanly into a column in excel.

I figure it is possible now to just cleanly copy the images and put them in a column next to the descriptions.

Can anyone please give me a hand with this?

I've done VAB coding for MS Access and Excel so I think I can follow something like this.

Thanks TONS in advance.

John Wilson
12-07-2016, 07:07 AM
It is not possible to paste images into a cell or column in Excel. It may look like you are pasting into a cell but it actually pastes on top of the cell aligned with the top left. The image is not IN the cell and the cell does not resize to the image size. This means it is going to be difficult to make the cells align with the images and VERY difficult if the images have different aspect ratios.

"I was able to export the full list of descriptions cleanly into a column in excel."

I noticed your post on the MSFT forum where the code from Steve Rindsberg's site was used to get text elements into a CSV file. This works of course but a CSV file cannot contain images so it's a non starter for images.

silvanet
12-07-2016, 07:21 AM
It is not possible to paste images into a cell or column in Excel. It may look like you are pasting into a cell but it actually pastes on top of the cell aligned with the top left. The image is not IN the cell and the cell does not resize to the image size. This means it is going to be difficult to make the cells align with the images and VERY difficult if the images have different aspect ratios.

"I was able to export the full list of descriptions cleanly into a column in excel."

I noticed your post on the MSFT forum where the code from Steve Rindsberg's site was used to get text elements into a CSV file. This works of course but a CSV file cannot contain images so it's a non starter for images.

Ok, so maybe into another program?


I'm just trying to bring the list of photos and descriptions out of my pdf into something that I can easily select the pics & descriptions from.


I tried exporting to Word, but the export was real messy.


In PowerPoint, each pic is in an object and there are like thirty to a page with the descriptions in text boxes under each (also very cumbersome to work with).


Would what I'm trying to do be possible in Access?


Yes, of course I was aware that the csv file would not work. I just meant it as an example of coding. The images are all the same aspect ratio.


Any ideas would be helpful and welcome.