Run PowerPoint with the exe macro file. RRS feed

  • Question

  • My development environment is Windows 8 64Bit & 10 64Bit, and Visual Studio is 2013.

    The VBA file I wrote looks like this:

    // source start !!!

    Imports PowerPoint = Microsoft.Office.Interop.PowerPoint

    Module Module1

        Sub Main(ByVal path() As String)

            Dim oApplication As PowerPoint.Application = Nothing

            Dim oPressentation As PowerPoint.Presentation = Nothing


                oApplication = New Microsoft.Office.Interop.PowerPoint.Application()

                oPressentation = oApplication.Presentations.Add

                Dim macroPath As String = path(0)

                Dim savePath As String = path(1)




            Catch ex As Exception


                If Not oPressentation Is Nothing Then

                    oPressentation = Nothing

                End If

                If Not oApplication Is Nothing Then

                    oApplication = Nothing

                End If



            End Try

        End Sub

    End Module

    // source end !!!

    When the function is executed, it executes the power point and executes the macro.

    However, if the power point is executed before executing the function, the function does not work properly when the exe file is executed. The same power point just turns on and ends.

    In addition, after executing the function, even if you run the power point on the desktop.
    Tuesday, October 22, 2019 6:04 AM


  • Hi,

    Please ask in the following forum.


    Thank you for your understanding.

    Thank you for participating in the forum activities.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Pada_ Tuesday, October 22, 2019 6:34 AM
    Tuesday, October 22, 2019 6:12 AM