Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing save as file format for excel from VB.net


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

--
johnr
-----------------------------------------------------------------------
johnrc's Profile: http://www.excelforum.com/member.php...fo&userid=3026
View this thread: http://www.excelforum.com/showthread.php?threadid=49936

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Changing save as file format for excel from VB.net

? xlExcel5
39

use the number 39

this might be more preferable:

? xlworkbooknormal
-4143


--
Regards,
Tom Ogilvy


"johnrc" wrote in
message ...

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

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

Additional information: The process cannot access the file
"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 appreciated


--
johnrc
------------------------------------------------------------------------
johnrc's Profile:

http://www.excelforum.com/member.php...o&userid=30267
View this thread: http://www.excelforum.com/showthread...hreadid=499360



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to save an excel file to dBase format? rdonohue Excel Discussion (Misc queries) 2 March 28th 09 12:22 AM
Save Excel File in Other Format Shamir Excel Discussion (Misc queries) 0 February 8th 07 04:53 AM
Why will Excel will not save text format in a .csv file davis Excel Worksheet Functions 1 January 25th 06 05:44 PM
Save excel file as another format file ExcelReport Excel Programming 5 July 12th 05 02:01 PM
Using Macro to Save xls to txt without changing file format SSciarrino Excel Programming 0 November 1st 04 06:15 PM


All times are GMT +1. The time now is 01:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"