hi, i have a vb6.0 application, and im writing some data from it to an excel template, everything works fine, but i print the page and then i want to close excel without promting if i want to save my work.
i tried to save as the file, to a predermitaed file i set, but then the scond time i get a message if i want to overwrite the file that already exists.
im sure there is a way to avoid this, but i cannt find it, any ideas??
my code looks more or less like this:
.... i write all my data to the object here
thank You very much!!
Eli
i tried to save as the file, to a predermitaed file i set, but then the scond time i get a message if i want to overwrite the file that already exists.
im sure there is a way to avoid this, but i cannt find it, any ideas??
my code looks more or less like this:
Code:
Dim oExcelApp As Excel.Application
Dim oWs As Excel.Worksheet
Dim oWb As Excel.Workbook
Dim Path As String
Set oExcelApp = CreateObject("EXCEL.APPLICATION")
oExcelApp.Visible = True
oExcelApp.Workbooks.Open FileName:=App.Path & "\Fac2.xls", ReadOnly:=True, ignoreReadOnlyRecommended:=True
Set oWs = oExcelApp.ActiveSheet
Set oWb = oExcelApp.ActiveWorkbook
With oWs
.... i write all my data to the object here
Code:
.PrintOut
End With
oWs.SaveAs App.Path & "/tmp.xls"
oExcelApp.Application.Quit
Set oExcelApp = Nothing
Set oWs = Nothing
Set oWb = Nothing
thank You very much!!
Eli