+ Reply to Thread
Results 1 to 2 of 2

Changing save as file format for excel from VB.net

  1. #1
    Registered User
    Join Date
    01-09-2006
    Location
    Newport, South Wales
    Posts
    1

    Question 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 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

  2. #2
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1