Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • 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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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