View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
atpgroups atpgroups is offline
external usenet poster
 
Posts: 40
Default Objects with .type property

I am writing an excel macro to automate some aspects of vehicle ECU
development.

The idea is to type the names of ECU calibratables in the column
headers and the values for them to take in the cells below. The macro
then steps through line by line and changes the values on the ECU by
means of an API in a 3rd party application that we use.

The variables on the ECU can be boolean, scalar, 2D maps, 3D maps or
strings.

The API returns objects which point to the memory locations on the ECU.


I read the colum headers, use an API function to find and return the
corresponding object and assemble these objects into a collection.

The Objects returned have a property called "Type", so for example
myObject.Type might be 6, referring to a 3D Map. The code uses this
property to decide how to handle the ECU variable in question.

Unfortunately, I have a problem. The "String" type of variable falls
foul of a bug in the API. I can trap this readily enough, but I need to
put a placeholder in the collection such that when the code asks for
the .Type property it gets a sensible answer and can react
appropriately.

I thought I could do this by creating a class module with a .Type
property, but VBA won't let me do this, as Type is a reserved word...

Can anyone suggest a workaround?

In summary: I want to place something (anything) in a Collection such
that [RandomItem].Type returns an integer value.

Andy Pugh
Ford UK