0

I am absolutely new at VBA. What I want to do is exactly same with this person Excel data into PowerPoint slides

  1. make slides at ppt for each row of excel
  2. make texts box at each slides for columns of each row

what's the problem is, while I tried this code (the page saying this is "a really weird thing to want to do" but this is what I really wanted for last 4 years...)

i got a error message saying

"Compile Error, syntax error"

highlighting

"Dim OWB As New Microsoft Excel:" (line 3)

(unlike the person above, who use Office 2011 on Mac, got error massage for line 4)

I am using Windows/office 365

Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
  • Did you follow the instructions in the text: *"Paste this into a new module inside your PowerPoint presentation. You will need to add in a reference to Microsoft Excel Objects (Tools -> References)."*? The error message you got indicates you may have forgotten to set the reference to the Excel object. – Doc Brown Nov 24 '20 at 07:27

1 Answers1

0

This all certainly sounds very doable in VBA - you only have to find the correct magic set of windows / office object names to reference and ta-da it will work. Eventually.

Or perhaps not do it with VBA at all. Your problem sounded a lot like the "mail merge" feature in Word that pulls names and addresses from an excel file to automatically generate personalised letters to multiple recipients. I remember my mom doing this as a teacher in the 80's to write letters to parents... using lotus 123 and word perfect! And sure enough, someone else has already typed up a nice how-to for you: https://georgejmount.com/mailmerge/

The concept is quite simple:

  1. Insert Excel data into fields in Word outline using "Mail Merge"
  2. Import Word outline into PowerPoint using New slides > Slides from Outline
ExcelEverything
  • 3,114
  • 1
  • 4
  • 16
  • If you still want to go the VBA route, it might just be easiest to drop the excel data straight into a blank slide in the pptx as an excel object. You should then be able to easily navigate to the Excel object without have to worry about creating an Excel instance or linking to an external file or data source. – ExcelEverything Nov 24 '20 at 07:19