views:

183

answers:

2

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.

+1  A: 

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.

0xA3
A: 

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

MasterMax1313
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.
0xA3