• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Cann't open excel file

Cann't open excel file. SOS.
test6comp.xlsx
0
zhshqzyc
Asked:
zhshqzyc
  • 4
  • 3
1 Solution
 
zhshqzycAuthor Commented:
I am using 2007.
0
 
jimyXCommented:
Change the extension to xls instead of xlsx
0
 
zhshqzycAuthor Commented:
The original file already has xlsx format.
0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
Lordy123Commented:
Try the attached file.
test6comp.xlsx
0
 
jimyXCommented:
I suspect that you just changed the extension of the file manually (from xls to xlsx) is it?
If you want to convert Excel files from xls to xlsx then open the original file and then "Save As" and select the new format.
0
 
jimyXCommented:
I just changed the xlsx to xls and it opened fine.
test6comp.xls
0
 
zhshqzycAuthor Commented:
The origianal file is a xls file, after some processing I save it as xlsx file.
The c# code
 if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    MessageBox.Show("You selected the file: " + saveFileDialog1.FileName);
                    string sname = saveFileDialog1.FileName;
                    //xlWorkBook.SaveAs(sname, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
                    xlWorkBook.SaveCopyAs(sname);

Open in new window

How to modify it?
0
 
jimyXCommented:
If the original file is xls, you can't just save it as xlsx, you need to convert it.
I am not sure what process you do before saving but if you are not sure then just maintain the original extension.
Adjust the filter of the the SaveFileDialog to xls?

You can ask a question about this in the C# zone.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now