Unable to run excel macro located at network share folder using VB.net

-1

I've tried to execute VBA excel macro named "mainCOC" and excel file name COC.xlsm. my VS Studio 2012 and MS Office 2013, .NET Version 4.5 Here is my simple function to open and run macro.

    Try
      appExcel = Microsoft.VisualBasic.Interaction.CreateObject("Excel.Application")
      appExcel.Workbooks.Open(filename:="E:DOTNET_COFC\COC.xlsm", ReadOnly:=True, Notify:=True)
      appExcel.Run("mainCOC")
      MsgBox("Successfully run macro")
    Catch ex As Exception
      MsgBox(ex.ToString)
    Finally
      appExcel.Workbooks.Close()
    End Try

Unfortunately i catch an error : System.Runtime.InteropeService.COMException (0x80010105): The server threw an exception. (Excepting from HRESULT: 0X80010105 (RPC_E_SERVERFAULT)) .......

ANYONE CAN FIGURE OUT WHAT HAPPEN?

excel
vb.net
asked on Stack Overflow Dec 17, 2018 by Norhisham Ya • edited Dec 18, 2018 by Norhisham Ya

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0