Sign In  Sign Up Live-Chat

Cells - wb.Save not perserving original documents fileFormatType

Last post 07-07-2008, 1:54 PM by dybrn. 6 replies.
Sort Posts: Previous Next
  •  07-02-2008, 5:45 PM 134118

    Cells - wb.Save not perserving original documents fileFormatType

    Perhaps its just my assumtion, but...
    If I have a xlsx file and call Workbook.Save(fileName) the format seems to be changed from xlsx to xls
    then when I try to open my new document I get an error from excel... "Excel cannot open the file 'myfile.xlsx' because the file format of file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."
    If I change the extension of the file to .xls it opens fine, or if I start with a xls file it saves fine, or if I call Workbook.Save(fileName, Aspose.Cells.FileFormatType.Excel2007Xlsx) it works fine -- This is not ideal because my source file format type may differ from xlsx to xls

    Do i have to look at the fileFormatType of my source filemy file before saving and save accordinly, or is this a bug in your software that is not preserving the FileFormatType? If I have to look before save how do I get the original fileFormatType? I could look at the file extension but that is not always accurate.


     
  •  07-03-2008, 12:52 AM 134147 in reply to 134118

    Re: Cells - wb.Save not perserving original documents fileFormatType

    Hi,

    No, it's not a bug. Currently, we only support fileformattype auto-detection (for .xls and .xlsx files) when you open the file using Workbook.Open() method. I think you can do it according to the extension of the file and specifying the related fileformattype when saving the file.

    We can implement your desired feature but I'm afraid some users may not want it to be implemented.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  07-03-2008, 10:19 AM 134202 in reply to 134147

    Re: Cells - wb.Save not perserving original documents fileFormatType

    You say currently you only support fileformattype auto-detection when you open the file using Workbook.Open(), and that is exactly what I am doing.  I Workbook.Open() a xlsx file and then Workbook.Save() that file I expect it to save in the xlsx format. If I Workbook.Open() an xls file and then Workbook.Save() that file I expect teh format to be xls.
    Currenly I am experincing this: I Workbook.Open() an xlsx file and  then Workbook.Save() that file the extension is xlsx but the format is now xls (I dont want this, the format shoul stay xlsx)

     
  •  07-03-2008, 12:57 PM 134225 in reply to 134202

    Re: Cells - wb.Save not perserving original documents fileFormatType

    Hi,

    Thanks for providing us further details.

    We will check the feasibility of your desired feature if we can implement it for your need.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  07-04-2008, 1:34 AM 134291 in reply to 134225

    Re: Cells - wb.Save not perserving original documents fileFormatType

    Hi,

    We have supported FileFormatType auto-detection while saving the excel file using Workbook.Save() method similar to Workbook.Open() method, so you don't need to provide FileFormatType while saving the file anymore.

    A fix would be available soon for you.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  07-04-2008, 5:07 AM 134328 in reply to 134291

    Re: Cells - wb.Save not perserving original documents fileFormatType

    Hi,

    Kindly try the Aspose.Cells version 4.5.0.3 posted @: http://www.aspose.com/community/forums/thread/134097/support-for-replace-function-in-.net.aspx

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  07-07-2008, 1:54 PM 134592 in reply to 134328

    Re: Cells - wb.Save not perserving original documents fileFormatType

    That works. Problem solved.
    Thank you much =)

     
View as RSS news feed in XML