It is a Openedge/Excel question. How do i "convert" VBA object model to work in OE.
You don't "convert" the object model. The model is conceptual: it tells you about the objects you can instantiate and manipulate, and their methods and properties, and relationships between objects.
You can implement code that uses the model in different languages, e.g. in VBA, in a macro-enabled workbook; or in ABL, via COM Automation. The code samples you will find online will likely be in VBA, or perhaps C#.
When I want to use ABL to programmatically create something in Excel (accepting that COM Automation is slower than molasses in January), I follow a process like this:
- Design and create the finished product (worksheet/char/whatever) in Excel, manually.
- Once I'm happy with the design, I create it again from scratch, with the Excel macro recorder enabled. This produces VBA code that should reproduce what I want. Of course this code won't be ideal. I will likely want to make it more efficient or flexible, e.g. parameterize hard-coded values, collect like operations into loops, etc. But importantly, it tells me which objects and methods/properties I should be using to get the result I want. It's very helpful when I'm dealing with an unfamiliar part of the object model
- I write equivalent code in ABL syntax and then invoke it via an Excel.Application.
- Test, debug, etc. There can be various pitfalls to resolve, e.g. the object model says a parameter is optional and OpenEdge thinks otherwise.
There are other ways to programmatically generate Excel workbooks, but this is what I do. It is relatively accessible for beginners.
It can also be helpful to use the OpenEdge COM Object Viewer utility to get an ABL-centric view of the objects, methods, and properties in a type library file. Run %DLC%\bin\proobjvw.exe and then open excel.exe. You should see something like this:
