Open & Close Excel file in the background
Hi, I tried ASP to open and close an Excel file in the background, allowing a macro to perform some actions:
Set objXL = Server.CreateObject("Excel.Application")
objXL.Visible = False
objXL.DisplayAlerts = False
Set objWkb = objXL.Workbooks.Open("C:\test.xls")
objWkb.Close , True
Set objWkb = Nothing
Set objXL = Nothing
But this didn't work, the test file was locked. Any wrong with the code? Thanks in advance.
Mike
|