Changing save as file format for excel from VB.net

J

johnrc

Hi,
Can anyone help please.
I am trying to change the save as in Excel through VB.net from a cs
type back to an xls. I have attached the code below that i am using bu
it fails to run with:-

An unhandled exception of type 'System.IO.IOException' occurred i
microsoft.visualbasic.dll

Additional information: The process cannot access the fil
"C:\temp\temp.csv" because it is being used by another process.

My Code:-
excelApp.ActiveWorkbook.SaveAs(Filename:="C:\Temp\Temp.xls"
FileFormat:=("xlExcel5"), _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False
_
CreateBackup:=False)
excelApp.Visible = True

Any help appreciate
 
T

Tom Ogilvy

? xlExcel5
39

use the number 39

this might be more preferable:

? xlworkbooknormal
-4143
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top