First of all, thanks for your help
This is an amazing site!!!
Ok this is my problem
I have this code (THANKS TO YOU GUYS!!)
With that code I change the content of the excel file "plantilla1.xls" and I use the classic "Save As" file dialog window to save it where ever I want.
Dim oSheet As Object
Dim xlTemp As Application
xlTemp = New Application
xlTemp.Workbooks.Open(System.Windows.Forms.Application.StartupPath & "\plantillas\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"
Dim sv As New SaveFileDialog
sv.AddExtension = True
sv.CheckPathExists = True
sv.DefaultExt = ".xls"
sv.Filter = "Excel Files|*.xls"
sv.OverwritePrompt = True
sv.Title = "Save Excel File As..."
If sv.ShowDialog = System.Windows.Forms.DialogResult.OK Then
oSheet = Nothing
Dim pro() As Process = System.Diagnostics.Process.GetProcessesByName("EXCEL")
For Each p As Process In pro
But After the new file is save it I have problems with the file when I try to open It
I made this example: I save a new file with the name test.xls, when I try to open the file the excel show me the following error:
After I push the "ok" button the file is open, but as you can see in the following image It is open with the name of the original file "plantilla1" not with the new name "test"
Do you know what is happend?? why I cannot open the new file normaly?????