Convert Excel VBA to Powerpoint VBA

kasbac

Active Member
Joined
Jan 2, 2008
Messages
344
Hi

I have created the following VBA code that imports a number of slides into a master powerpoint prensentation.
Code:
ActivePresentation.Slides.InsertFromFile "c:\test\xxx.ppt", 3, 1, 1 
ActivePresentation.Slides.InsertFromFile "c:\test\xxx.ppt", 5, 2, 2 
ActivePresentation.Slides.InsertFromFile "c:\test\xxx.ppt", 14, 3, 3 
ActivePresentation.Slides.InsertFromFile "c:\test\xxx.ppt", 18, 4, 4 
ActivePresentation.Slides.InsertFromFile "c:\test\xxx.ppt", 24, 5, 5 
ActivePresentation.Slides.InsertFromFile "c:\test\xxx.ppt", 25, 6, 6

I have two issues with the above that im hoping for some help with:
1. I would like for the macro to look in the same directory as the master file is found for the minor presentations
2. The file name will change slightly on a weekly basis and i therefore need the macro to make a "fuzzy" search when identifying the file.

I have solved both problems in a VBA code i have for a excel workbook:

Code:
With Application.FileSearch
        .NewSearch
        .LookIn = myDir
        .FileType = msoFileTypeExcelWorkbooks
        .Filename = "*yyy*"
            If .Execute > 0 Then
            Set yyy = Workbooks.Open(.FoundFiles(1)) 'change workbook name x2 first with_
            End If
    End With


yyy.Sheets("yyy").UsedRange.Copy Destination:=ThisWorkbook.Sheets("yyy").Range("A2")
Application.CutCopyMode = False


My problem with that is that I do not know how to convert it to powerpoint format? can anyone help with this?

If any clarifications is needed please let me know
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,225,626
Messages
6,186,095
Members
453,337
Latest member
fiaz ahmad

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top