Import module into Powerpoint file using excel vba

lpking2005

Board Regular
Joined
Mar 21, 2011
Messages
140
hi all,

Does anyone know how to import modules which are saved on the computer into a opened powerpoint presentation?

I have succeeded in doing this with importing into other excel files and i am trying to modify that code.

Everything works up until it trys to import the modules.

Here is my current code:

Code:
'Open the presentation


Dim PPT As PowerPoint.Application
Set PPT = New PowerPoint.Application
PPT.Visible = True
    
    PPT.Presentations.Open filepath
    


'Set filepath for modules
    ModulePath = "\\ukashntapps24v\qwb_pro\master\"


'Set Each of the Modules Filenames
    routine = "Full_Routine.bas"
    status = "Status.bas"
    revision = "Revision.bas"
    
'import modules
    
    PPT.ActivePresentation.VBProject.VBComponents.Import ModulePath & routine
    PPT.ActivePresentation.VBProject.VBComponents.Import ModulePath & status
    PPT.ActivePresentation.VBProject.VBComponents.Import ModulePath & revision

Any help would be greatly appreciated.
Thank you.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Sorry, I have just found out the error.

It was the macro security in powerpoint, the "Trust Access to Visual Basic Project" was not checked.
 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,944
Members
449,095
Latest member
nmaske

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