Solved

Cann't open excel file

Posted on 2011-03-25
8
269 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
 
LVL 6

Expert Comment

by:Lordy123
ID: 35215809
Try the attached file.
test6comp.xlsx
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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 50 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel - Row Height +1 VBA 2 24
Excel 6 18
How to compare data in excel 5 26
+1 to an even value 4 13
Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now