Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Cann't open excel file

Posted on 2011-03-25
8
Medium Priority
?
291 Views
Last Modified: 2012-05-11
Cann't open excel file. SOS.
test6comp.xlsx
0
Comment
Question by:zhshqzyc
  • 4
  • 3
8 Comments
 

Author Comment

by:zhshqzyc
ID: 35215768
I am using 2007.
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35215772
Change the extension to xls instead of xlsx
0
 

Author Comment

by:zhshqzyc
ID: 35215801
The original file already has xlsx format.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:Lordy123
ID: 35215809
Try the attached file.
test6comp.xlsx
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35215814
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
 
LVL 24

Expert Comment

by:jimyX
ID: 35215836
I just changed the xlsx to xls and it opened fine.
test6comp.xls
0
 

Author Comment

by:zhshqzyc
ID: 35215905
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
 
LVL 24

Accepted Solution

by:
jimyX earned 200 total points
ID: 35216045
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question