Programmatically detect a syntax error in a macro?

G

Guest

I'm working on forensice sofware, using vb6, that opens Excel spreadsheets
and generates images of all possible combinations of available data. This
means that one thing we have to do is run the available macros. The problem
is that if we encounter a macro that contains a syntax error the Excel VBA
window opens up and processing doesn't return to our application until the
syntax error is resolved. We would prefer just to note that the particular
macro contains an error and we will just bypass it. Is there a way to detect
syntax errors without having Excel open anything up?

Thanks,

Jeff Beem
 
G

Guest

Nothing that I know of. The error handling in VB6 and VBA is a little cheesy.
Errors are not pushed up the stack, they die with the procedure. If you can
move to vb.net you might be able to resolve this as it uses more classical
error handling.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top