1

I have an MS Office 2003 excel file with macro. I have to parse the VBA code in macro using c#. While parsing i have to identify whether the keyword is a method name or property.

And also is there a component from Microsoft to access all the VBA functions dynamically using reflection in c#?

Is there a way to do this? If so please suggest.

2 Answers 2

1

Because the syntax of reading a property and calling a sub/function without parameters might be identical you will have to resolve all symbols and check their definition to see whether a symbol is a property or a sub/function.

Sign up to request clarification or add additional context in comments.

Comments

0

The easiest would be to track whether the object name is preceded by "Function" or "Sub" as that would indicate a method name as opposed to a property

1 Comment

This however would only work for property/method definitions. I think the OP wants to know whether a reference is a method or a property.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.