Hi,
I have to run a simple Macro on an Excel File (Microsoft Excel 2003) from an asp .net application
on my local machine (Windows XP) the macro works correctly, but if I run the application on the web server (Windows Server 2003) at the "oXL.Run("Macro1")" instruction the application get stopped.
I set all the permissions on the server...
What else can I do?
follow my application code:
Dim oXL As Object = Nothing
Dim oXLWorkbooks As Object
Dim oXLWorkbook As Object
Dim oXLSheets As Object = Nothing
Dim oXLSheet As Object = Nothing
Dim oXLRange As Object = Nothing
Try
oXL = CreateObject("Excel.Application")
oXL.DisplayAlerts = False
oXL.Visible = True
oXLWorkbooks = oXL.Workbooks
oXLWorkbook = oXLWorkbooks.Open(PathFileMacro, 0, True)
************************STOP HERE
'run the macro
oXL.Run("Macro1")
*********************************************
Catch ex As Exception
Exit Function
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oXLWorkbook)
oXLWorkbook = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(oXLWorkbooks)
oXLWorkbooks = Nothing
oXL.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(oXL)
oXL = Nothing
CloseExcel()
GC.Collect()
GC.WaitForPendingFinalizers()
End Try
thanks....
Bruno