Link to home
Start Free TrialLog in
Avatar of altariamx2003
altariamx2003Flag for Mexico

asked on

how to save an Excel file with Visual basic .NET

Right know Im using this code to open an existing excel file to modiy it, and save it with other name

        Dim oSheet As Object
        Dim xlTemp As Application

        xlTemp = New Application
        xlTemp.Workbooks.Open("C:\plantilla1.xls")
        oSheet = xlTemp.Worksheets(1)
        oSheet.Range("A1").Value = "Last Name"
        oSheet.Range("B1").Value = "First Name"
        oSheet.Range("A1:B1").Font.Bold = True
        oSheet.Range("A2").Value = "Doe"
        oSheet.Range("B2").Value = "John"
        xlTemp.SaveWorkspace("c:\test.xls")
        xlTemp.Quit()

This works ok, but I would like to know how to save the file with other name using a classic "save as file dialog" windows with VB

is that possible???

An also I have another problem with my code as you can see the excel remains on the process list User generated image
I woul like to know how to remove the excel process after I close the application by code

ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
this is another reason why I prefer to use a component like http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx to handle my Excel files
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>Do you work for aspose? :-)

No I don't. But I have been using their almost unique product on many projects (as I am a consultant) for many years now with great success.
Avatar of altariamx2003

ASKER

YOU GUYS ARE AMAZING!!!!!