• Programatically open then re-save an Excel document
    5 replies, posted
A bit of a strange one... I'm trying to open an ".xls" file in Python / XLRD which works a tread for most of the sheets but HR is breaking something with a certain kind of report and I can't open the spreadsheet in Python. I can however, if I re-save the spreadsheet. I'd say that something is broken and re-saving it resolves the issue. So, my question is, whats a good way to quickly open then re-save an excel document programatically? Is there a converter out there that can convert it to something and then back again? Already tried a COM object, but that retarded File Security warning pops up...
.NET has some semi-decent wrappers around the Office suite you could use to open and save the document. Although I do believe they're based on their COM parents. [url=http://www.codeproject.com/Articles/5123/Opening-and-Navigating-Excel-with-C]link[/url]
You should probably find out what the actual issue is instead of just bandaid fixing it. You can't be certain that you're not going to lose data from it down the road, because fixes like this are usually a good indication that something strange is happening.
I wish I could but the information is coming from another department and they aren't the most technically savvy, and they are VERY afraid to admit it. I'll see if I can sweet-talk the guy to send them in CSV or TSV format instead. I hate technophobes...
[QUOTE=towerofpower256;40393683]I wish I could but the information is coming from another department and they aren't the most technically savvy, and they are VERY afraid to admit it. I'll see if I can sweet-talk the guy to send them in CSV or TSV format instead. I hate technophobes...[/QUOTE] Don't take this as a personal attack, but that's kind of a lame excuse. If you're doing this for a job (which it sounds like you are) then it's your job to get the info you need to fix the problem you need to fix. That's part of being a professional. You don't need to sweet talk anyone, tell him what info you need and why you need it and don't take no for an answer.
[QUOTE=KmartSqrl;40404697]Don't take this as a personal attack, but that's kind of a lame excuse. If you're doing this for a job (which it sounds like you are) then it's your job to get the info you need to fix the problem you need to fix. That's part of being a professional. You don't need to sweet talk anyone, tell him what info you need and why you need it and don't take no for an answer.[/QUOTE] Sall good. Not really doing it for a job, but doing it at work. Normally what happens is that when something changes in HR, they send us an email to let us know so that we can update AD. However, they've gotten slack as of late and instead, now they just send us an Excel dump of their database every Monday. I'm trying to make a program to streamline things and generate an HTML report stating what needs updating.
Sorry, you need to Log In to post a reply to this thread.