altariamx2003
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:\t est.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
I woul like to know how to remove the excel process after I close the application by code
Dim oSheet As Object
Dim xlTemp As Application
xlTemp = New Application
xlTemp.Workbooks.Open("C:\
oSheet = xlTemp.Worksheets(1)
oSheet.Range("A1").Value = "Last Name"
oSheet.Range("B1").Value = "First Name"
oSheet.Range("A1:B1").Font
oSheet.Range("A2").Value = "Doe"
oSheet.Range("B2").Value = "John"
xlTemp.SaveWorkspace("c:\t
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
I woul like to know how to remove the excel process after I close the application by code
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>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.
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.
ASKER
YOU GUYS ARE AMAZING!!!!!