PDA

View Full Version : How to access separate module macro from different project



NotSoGoodPro
01-05-2021, 12:53 PM
Hello :hi:,

I'm not sure if I'm even doing this correctly but it seems like it should be extremely simple. Anyway, I currently have an excel spreadsheet embedded into a PowerPoint, VBAProject(Worksheet in MWP - Current.pptm) There is a macro in Module1 of this excel which deletes an entire row. This macro is working properly as I've tested it. It's in

'Deletes 1 row from embedded excel sheet in PowerPoint.
Sub SolarLunarUpdate()
Rows("2:2").Select
Selection.Delete Shift:=xlUP
End Sub


This PowerPoint has macro menu I can click which runs macros in the PowerPoint. A specific Macro, UpdateTitleSlide() basically just updates the title but its in a Module inside of VBAProject( MWP - Current.pptm).

'This is much shorter than what it actually does, but for understanding of what I have
Sub UpdateTitleSlide()
'some stuff here (not important)
Call SolarLunarUpdate
End Sub

What I would like to do is click the run UpdateTitleSlide Macro. And from inside of that Macro it calls the SolarLunarUpdate() macro, which will access the embedded excel spreadsheet and delete a row.

Thanks... I hope I explained that well : pray2:

SamT
01-05-2021, 02:38 PM
It's been a long time, so, I'm probable wrong, but...

I believe that you will need to access the desired macro thru a sub in ThisWorkbook.

Dim X As new Excel blahblah
X.SubToRunDesiredMacro

X + Dot + Name of Macro in ThisWorkbook

NotSoGoodPro
01-05-2021, 03:36 PM
I'm not exactly sure what you mean? Sorry.