How to troubleshoot 'Root Element is missing' when using EPPlus on complex spreadsheet - epplus

using version 4.5.3.2 of EPPlus on a spreadsheet produced in Excel. Using a test:
I am getting an XmlException "Root element is missing". I can load the file in Excel (MS Office 365 ProPlus) without any problems. How do I a diagnose? Thanks!

Not sure the issue, but debugging this test resulted in abnormal behavior; running the test resulted in the test executing correctly and I am able to make assertions about the UUT just fine. I just can't inspect parts of the test as it executes.

Related

Getting Error 'HasFile' is not a member of 'FileUpload' VB.NET

I randomly get an error saying HasFile is not a member of FileUpolad.
I'm using a file upload button to upload images to a server. This usually runs; however, every once in a while it errors out. Sometimes the error is caught by Visual Studio during run time, other times it will be a Server Error in Application. Compilation Error when I load the page in debug mode. I've check dependencies and everything seems to be fine. Even the IntelliSense brings up HasFile with I am writing the code.
Usually re-writing the line or restarting Visual Studio resolves the issue, but it keeps coming up randomly.
I happened to figure out what the problem was. Since it was my first time doing this I had a test class in the solution. The test class was named FileUpload. Rookie mistake. I can't believe I didn't catch that earlier!

Office server automation failed while calling "CopyPicture" on some computers

We have wrote an application with C++/Qt which reads some data from multiple excel files and then generate a word report. We have used benefits of Office automation server to read/find and copy data from excel files and write them into a single word file.
The application works fine without any significant problem in my office computers. Yesterday I've decided to copy the app into my laptop which has same OS and office version. After running the app, it seems that somethings wrong my OS/Office. None of the data are copied into word file. After debugging I've figured out that the app actually can read/write office files but failed to call CopyPicture method of automation!!!
I wanted to copy the range as picture, so I have used "CopyPicture" method. but it seems that the vba fails to call copyPicture on my laptop.
I'll be very appreciated for any hints. Thank you
I've found the problem and it's with excel docs which are used to copy data from. In these files, there are some embeddedCharts. after removing these charts the code works fine!!!! (very odd). Anyway, I've tried to make excel file visible in order to see if the operation goes well or not. After running (with embeddedCharts) the code worked fine (more odd!!)
excel->dynamicCall("Visible", true );
I don't know the reason but with making excel file visible, the error with copyPicture is gone!

'File Not Found: VBA6.dll' Error - Strange Behaviour

I am running Windows 8 with Office 2013 (64-Bit). I am trying to continue developments in VBA in Excel that I started with Office 2010 (32-Bit). I am aware of the necessary 64-Bit alterations however I am receiving confusing configuration errors.
Here is the problem:
If I create a new Excel file and VBA project; all my VBA code functions correctly. No problems.
If I open and use a macro from a file that was developed/used in Office 2010 previously, I receive a "File Not Found: VBA6.dll" error message.
Once I start receiving the message, I receive it on all VBA macro's; even the new ones that (not more than 30 seconds) previously worked fine.
If I then re-create a new Excel file and new VBA Project, that individual piece of new code works fine. No problems - until I run code in one of the 'error files'. The fault then spreads into my new developments.
It's as if Excel is getting its references confused but every time I check them (on good or bad files) they are always exactly the same.
Note:
None of my references are missing.
I don't have VBA6.dll on my system; I have VBA7 and the 'Visual Basic for Application' reference refers too 'C:\Windows\SysWOW64\msvbvm60.dll'
There are two other 'Visual basic for Application' references on the list but it wont let me change them
It works on new files without VBA6.dll so I assume it isn't required?
I have checked for and installed all the latest Windows updates.
What should I do to troubleshoot this problem?
If you think I need VBA6.dll, is that because the referenced libraries use it?
If so then why are they not using VBA7?
And why does it work correctly before opening an old VBA6 file? Does Excel suddenly decide all files must use VBA6 just because one file did previously?
Anything to cure me of my confusion is much appreciated,
Best regards
EDIT: I almost forgot to mention;
When I try to debug the error after receiving it, Excel crashes (every time).
I also sent a 'bad file' to a colleague who [with the same system configuration] hasn't yet received this problem - and they also received the error. Suggesting it is something wrong with the files?
EDIT 2:
The problem is not yet resolved. I hope the downvote will not hinder my chances of an answer.
I have also tried re-registering libraries but nothing has changed.
If I open a 'bad file' I can add new Macros and they work fine; but the second I run an existing Macro and receive the error, the new Macros do not work either.
The error was caused during Office 2013 (64-bit) installation. The VBA7 DLL was not registered correctly so I had to open regedit and manually input the correct filepath in both
HKEY_CLASSES_ROOT\TypeLib{000204EF-0000-0000-C000-000000000046}\
6.0\9\win32
4.2\9\win32
Replacing the 'C:\Windows\SysWOW64\msvbvm60.dll' data value (mentioned in the question) for Visual Basic for Applications to the VBA7 DLL filepath. Which on my system is:
C:\Program Files\Common Files\Microsoft Shared\VBA\VBA7.1\VBE7.dll
All files now work; I hope this solves the problem for anyone else in the future.

MS Excel - VBA Automation Error.

I have a suite of MS-Excel scorecard calculators that I send to 200 odd clients. In all client environments save 1 the calculators work 100%. However one client is experiencing the following problem.
Periodically the spreadsheet gets a Microsoft Visual Basic Run-Time Error. The exact message is:
Microsoft Visual Basic
Run-time error '-2147417848(80010108)':
Automation error.
As I mentioned, this happens only at one customer site. Everywhere else the spreadsheet runs 100%.
Can anyone shed some light as to why this happens at one site out of 200 odd.
It is possible to provide some diagnosis.
Do a search of user's system for any *.exd files. They may be in a hidden folder.
Delete any *.exd file you find. They are temporary files and will be rebuilt by Excel.
Try to run the file again. Sorry I can't provide more detailed help, but this is a start based on the information provided.

How to report failed testcase in jira using automation

I am automating a website using selenium webdriver with java, I want to write the result "Pass" or "Fail" in excel sheet. How can i automate the reporting of a failed test case in JIRA by taking the status from excel sheet.
Since you are already writing to an excel file, I understand that you are able to access the contents of the Excel Sheet. If this is not completed yet, you might want to consider using http://poi.apache.org/spreadsheet/index.html for this purpose. Once you have the status of the test cases, you can use the JIRA API to create bugs https://ecosystem.atlassian.net/wiki/display/JRJC/Home. A more specific example of how to do this is mentioned here (https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue).
However, since a bug (defect) usually requires more information than a simple PASS / FAIL, I would suggest that you might want to collect more information like the stack trace etc and save it in the excel file (or an XML file) when the test fails.
Which test runner are you using? If it is JUnit / TestNG, I believe a XML file is created by default for a test run, which might have some of this information.
You can use 'Apache POI' to read cells from Excel sheet and 'Jira Client' to update status in Jira.
'Jira Client' is a JIRA REST based client library for Java. You can read more about this here: https://github.com/rcarz/jira-client/blob/master/README.md