Writing a Parts List to Excel - version problem

Phenom
Phenom

I have a macro that iterates through a set of drawings and copies/pastes the parts list into an Excel spreadsheet.

I have done this using VB Express 2008 and Excel 2013.

Everything works fine.

However, some workstations still have Excel 2010 installed and the macro will not work on those.

 

Could someone advise me what I need to do to make it work on Excel 2010.

HP Z420 16GB RAM
Quadro K4000
ST7 MP10 on Windows 7 Pro 64.
2 REPLIES

Without seeing any code, it's virtually impossible for us...

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Without seeing any code, it's virtually impossible for us to help. I can tell you that what you're experiencing is a common problem when trying to automate various versions of Microsoft Office with a single code base. Microsoft likes to make big changes in the APIs from version to version, some breaking changes. The first thing you need to do is identify where the code is failing. The easiest way to do that is debug the code on a machine with Office 2010. If that's not an option, the next thing to try is writing out debug information into a log file. Typically, a simple Try\Catch will work, then you take the Exception that you receive and examine the e.StackTrace. The StackTrace will generally tell you exactly which method failed.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Without seeing any code, it's virtually impossible for us...

Phenom
Phenom
Thanks Jason,
I followed your advice and used my home computer with Excel 2010 to do the build.
I did the original coding at home, but then transferred it to work to make some modifications.
Seems to work now.

I'll try and figure out a way to do it properly when (if?) I get time.
HP Z420 16GB RAM
Quadro K4000
ST7 MP10 on Windows 7 Pro 64.