Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am having some trouble manipulating Excel files. Currently I am
trying to create and then close an Excel file/application with the following code. It works fine, except it leaves an EXCEL application open, which I can see in the Task Manager. I have tried oExcel.Dispose(), but this generates an error. How can I correct this code so that the object is properly disposed of? Thanks! Public Sub CreateExcelFile(Optional ByVal sFileName As String = "") If Len(sFileName) 0 Then FileName = sFileName If Not Len(FileName) 0 Then MsgBox("The 'FileName' property must be set before the 'CreateExcelFile' method may be utilized", , "ERROR") Exit Sub End If oExcel = CreateObject("Excel.Application") With oExcel .SheetsInNewWorkbook = 1 oExcel = .Workbooks.Add .Save(FileName) .Quit() End With oExcel = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create a flat file in Excel | Excel Discussion (Misc queries) | |||
Can I use Excel to create this text file? | Excel Worksheet Functions | |||
How do i create an excel file using asp | Excel Discussion (Misc queries) | |||
Can you create an administrator for an excel file that is not sub. | Excel Worksheet Functions | |||
Create a xls File on Server without Excel? | Excel Programming |