 |
|
 |
Somebody has a fix for Loading Excel File with Macro using ExcelLibrary
regards
|
|
|
|
 |
|
 |
Hello.
I have a big xls file waiting for extract all the pictures from it. But my code stops extracting above 43 images.
sheet.Pictures.Count = 41 either, but I have more pictures in the .xls file.
My code:
void ExtractImages(Workbook book, string path)
{
int row = 0;
if (book.DrawingGroup == null) return;
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
Worksheet sheet1 = book.Worksheets[0];
while (sheet1.Cells[row,0].StringValue!= "#")
{
GlobalValues.pic = sheet1.ExtractPicture(row, 5);
if (GlobalValues.pic != null)
{
string filename = GlobalValues.pic.CellPos.Left
+ GlobalValues.pic.Image.FileExtension;
string file = Path.Combine(path, filename);
File.WriteAllBytes(file, GlobalValues.pic.Image.Data);
}
row++;
}
}
Anybody who meets this problem, and know the workaround, please tell me.
Anyway, it's a great library, fast as hell
Thank you.
modified 15 Jan '12.
|
|
|
|
 |
|
 |
Is there any way to get column count?
|
|
|
|
 |
|
 |
Is it possible to do any charting/graphs with this library?
Thanks,
Patrick
|
|
|
|
 |
|
 |
Very good one, but is there a way to Merge 2 cells!!
Thanks
plextoR
|
|
|
|
 |
|
 |
Whilst it's a good article, the DLL is no longer updated (Last updated 2 years ago), and has several severe flaws:
1.) Unable to save documents with small amounts of data, keeping them readable in Excel 2007
2.) ALL LAYOUT IS LOST WHEN SAVING!!!!
3.) Unable to open .xlsx files.
|
|
|
|
 |
|
|
 |
|
|
 |
|
 |
From where you are getting the Workbook class in the code...I mean to say from which assembly and namespace?
|
|
|
|
 |
|
 |
In the solution explorer for your project:
add a new reference
browse to the .dll
Then add the following to your .cs:
using ExcelLibrary.SpreadSheet;
Generally I wouldn't reply to a post this old, but since
I just ran into this problem I figured someone else might
benefit.
|
|
|
|
 |
|
 |
You "...figured..." right!
There are a lot of beginner C# programmers like myself out there, so thank you for that information. Without knowing that, I would've just abandoned your application altogether.
Thanks Liu!
-Nick
|
|
|
|
 |
|
|
 |
|
 |
I've used this library for years and it works great.
|
|
|
|
 |
|
 |
CompoundDocument keeps a reference to the underlying FileStream (CompountDocument.FileStorage) as a field and doesn't properly close it in case of error during reading.
To fix this CompountDocument should implement IDisopsable, call FileStorage.Close() within it's IDisposable.Dispose() method, and all places where a CompountDocument are created should be wrapped in a using() call.
Thanks,
Sam
|
|
|
|
 |
|
 |
Thanks for your suggest. Code submitted as r50 and r51. http://code.google.com/p/excellibrary/source/list
I am happy to work with people doing great projects.
|
|
|
|
 |
|
|
 |
|
 |
it saved my day thankyou Liu
|
|
|
|
 |
|
|
 |
|
 |
Hi!
Gotta say that this is a very good component, and saved me from depending on Microsoft Excel for file reading.
I was trying to figure out your code, but my lack of time (and experience with Excel files at your knowledge level) didn't let me to find a way to tell the Workbook.open method just to read only worksheet names at first instance and then just the data of that worksheet.
I have a problem viewing some Excel files because they have graphics or something embeded, but I only need to get to the worksheets that contains chewable data, but it seems that when I open the Excelbook it reads all first.
I hope you can give me a light to solve this problem.
Thanks a lot.
|
|
|
|
 |
|
|
 |
|
 |
Hi Junfeng Liu,
Your effort to make this library is very appreciable.
That's really very useful. I want to get forecolor of a cell. It can give backcolor, but how can I know what is forecolor of a cell? please help me because that's very important for me!
Thanks a lot!
|
|
|
|
 |
|
|
 |
|
 |
Great work,I have used in my WCF project
|
|
|
|
 |
|
 |
I need a function that writes a excel in a byte array instead of write in file. What i need change, i'm a noob and i don't unsderstand the process that's write the file if someone can help me?
|
|
|
|
 |
|
 |
Not sure what is the deal with Excel 2010 but if I try and open a xls created with this code excel throws and error when you try to open the file saying, "Excel found unreadable content in 'Newexcel.xls'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes".
It does not matter what you click, it never opens the file. I don't have any issues in 2007 or earlier versions of excel. Is there a workaround that anyone could share?
for reference here is the test code I am using to create the xls:
Workbook book2 = new Workbook();
Worksheet sheet1 = new Worksheet("Test1111");
sheet1.Cells[0, 1] = new Cell("this");
sheet1.Cells.ColumnWidth[0, 1] = 3000;
book2.Worksheets.Add(sheet1);
book2.Save("c:\\temp\\Newexcel.xls");
|
|
|
|
 |