Hi, I have a file which on opening manually gives alert that "the file is in diff format than specified by the file extention". What i do is, i try to load this file by specifying EXCEL_97_TO_2003 as FileFormatType. Here it gives exception. So in the catch block i reload the file wihout specifying the LoadOptions. With this i am able to get the workbook object. I call save on this workbook object, this time specifying the FileFormatType as EXCEL_97_TO_2003. With all these the file is saved properly but the only thing is that all the dates in the file loose its format. Originally they have the format as custom mmm, dd yyyy while after saving the format becomes general. I cannot post the file. Without file can you help me out of this?
Regards,
Rohan Naik
Hi,
It would be difficult for us to trace the issue without your template file. I suspect as your file either might be corrupted as you got error (e.g “…the file is in different format…”) in MS Excel while opening it into it or your so called file has different file format type whose extension might be renamed. Anyways, we request you to kindly attach your file here, so that we may look into your issue soon. Moreover, if you have concerns about your confidential data, you may make the post as private by using “Keep this post private” checkbox while answering this post or you may replace your your secured data with dummy data in the file and post it here.
Thank you.
Hi, I cannot post the file because of my company privacy policy. Anyways, a workaround could help me here. What i have in file is a date field November 02, 2012 00:00:00 with format as general. If i get a way by which i can search through the file for such formats and replace above with Nov 02, 2012 then this would solve my problem. Can this be achieved?
Thanks & Regards,
Rohan Naik
Hi,
Thanks for your posting and using Aspose.Cells for Java.
Kindly see this document. This document explains how to use Aspose.Cells for Java to find and replace data.
You can search data as contents or as formulas etc. Using these API(s), you can find your date data and then replace it with your desired date in text format.