|
Firstly, I am not asking for help on a programming issue here. I'm mostly just trying to see if anyone else here is or has in the past been experiencing any problems using the ClosedXML .Net library to open/read Excel files.
I have a simple process that has worked every day flawlessly for over 2 years, then out of the blue, started failing. Basically, ClosedXML was choking trying to open an Excel (*.xlsx) file. By choking, I mean it was an IO exception reporting that the file was corrupted. The weird thing is, I can copy that file to my desktop, open it in Excel, save it, copy it back to the server, and it works fine.
I am aware that a new version of OpenXML was released (right around the time that my process began failing???) with quite a few breaking changes. Coincidence?...I don't know yet.
What's new in the Open XML SDK | Microsoft Learn[^]
What I've tried:
0: Go to GitHub and get the latest ClosedXML libs. So this required a .net framework upgrade to 4.6+. No problem...compiles, go to open a spreadsheet and it complains about the XMLDocument version...go to GitHub, get that version and try again. It compiles fine, go to open a spreadsheet and now it whines about a netstandard library that it can't find. (sure this is an indication of inccompatibility) I tried different versions/combinations but the only way to get it working again was by reverting back to the original framework and original libraries. Back to square one.
1: Plead with the new IT guy responsible for scheduling that job to please change the format to CSV! (the previous IT guy was on a power trip and refused to change it despite numerous requests)
2: Investigating the idea of simply extracting the sheet1.xml file from the archive and parsing it out. Then I wonder why if it was that easy, why there are so few solutions that mention this approach. It's possible that I'm looking at an extremely simple/limited structure (no formulas/formatting/etc.) in this particular file, but it looks feasible. In the event that #1 fails, this will probably be the next path of attack.
3: Install Excel on the customer's server. Ya know, they did give me an admin account so in theory, I can install anything required to get the job done. Also, I have an old Office 2007 disk around here that should still work even if it never gets registered. If 1 and 2 fail, this may be the only option. Not only is it the worst option, but it's also the slowest option. I'd like to avoid this one.
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
kmoorevs wrote: if anyone else here is or has in the past been experiencing any problems using the ClosedXML .Net library to open/read Excel files. Nope...
.
.
.
.
Never used it.
run, hides and ducks
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I find is amusing that my comments elsewhere (not CP), when it can't be deciphered by AI, needs to go for "review" before it can be released. AI is talking but not really listening.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Gerry Schmitz wrote: AI is talking but not really listening. Damn it... that might be the proof that is becoming like humans faster than we thought...
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
|
Probably not the only one not fluent in Spanish
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." ― Gerald Weinberg
|
|
|
|
|
The Lines & Symbols[^] just suddenly appeared when I opened my project. They were not there before the last update.
Anyone know how to turn these off?? Note that I have 'Show procedure line separators' off.
The lines only appear on regions.
The purple boxes open a context menu.
Thanks
In theory, theory and practice are the same. But in practice, they never are.”
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
|
|
|
|
|
You already have it turned off.
I'm running 17.8.2 and cannot duplicate the problem, so I would say open an issue with MS on it.
|
|
|
|
|
Will the age old method work -
- Close VS (shut down the process in Taskbar) and open.
- If that does'nt work, shut down Windows, power off and open again.
|
|
|
|
|
You forgot the part: Bury a dead chicken in the back yard.
>64
Some days the dragon wins. Suck it up.
|
|
|
|
|
Which, I must say, is MUCH easier than burying a live chicken in the back yard.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
That sounds like somebody with experience. But probably use a rubber chicken next time.
Hogan
|
|
|
|
|
Turn them on and save your settings. Then turn them off. Microsoft uses "cached" information when showing settings and sometimes the cache gets out of sync with reality.
|
|
|
|
|
obermd wrote: and sometimes the cache the whole of Microsoft gets out of sync with reality.
FTFY.
|
|
|
|
|
It is not only MS, most caches are a PITA and do not work 
|
|
|
|
|
Wordle 899 4/6*
⬛⬛🟨🟩⬛
⬛🟩⬛🟩⬛
⬛🟩⬛🟩🟨
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 899 4/6
⬜⬜⬜⬜🟨
⬜⬜🟨🟨⬜
⬜🟩🟩🟩⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 899 3/6
⬜⬜⬜⬜⬜
🟨⬜🟨⬜🟨
🟩🟩🟩🟩🟩
|
|
|
|
|
Now, that's a nice solution:
Wordle 899 3/6
⬜⬜⬜⬜⬜
⬜🟧🟧🟧⬜
🟧🟧🟧🟧🟧
|
|
|
|
|
Wordle 899 6/6
⬜🟨⬜⬜🟨
🟨⬜⬜🟨⬜
⬜🟩🟩⬜⬜
⬜🟩🟩⬜⬜
⬜🟩🟩🟩🟨
🟩🟩🟩🟩🟩
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Wordle 899 4/6*
⬜⬜⬜⬜⬜
⬜⬜⬜🟩🟩
⬜🟩⬜🟩🟩
🟩🟩🟩🟩🟩
Happiness will never come to those who fail to appreciate what they already have. -Anon
And those who were seen dancing were thought to be insane by those who could not hear the music. -Frederick Nietzsche
|
|
|
|
|
⬜⬜⬜🟩⬜
⬜⬜🟨🟨⬜
⬜🟩🟩🟩⬜
⬜🟩🟩🟩⬜
🟩🟩🟩🟩🟩
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 899 3/6
⬛⬛⬛🟩⬛
⬛🟨🟨🟩🟨
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 899 6/6
⬜🟨⬜🟩⬜
⬜⬜🟩🟩⬜
⬜⬜🟩🟩⬜
⬜⬜🟩🟩⬜
⬜🟩🟨⬜🟨
🟩🟩🟩🟩🟩
Phew...
|
|
|
|
|
Wordle 899 3/6
⬛⬛🟨⬛⬛
⬛🟩⬛⬛🟨
🟩🟩🟩🟩🟩
Ok, I have had my coffee, so you can all come out now!
|
|
|
|