View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
vivmaha vivmaha is offline
external usenet poster
 
Posts: 42
Default VBA.convertFromJava("instanceof")=?

This doesnt work for user defined types.

Chip Pearson's typeOf does.

Thanks though.


"Rick Rothstein (MVP - VB)" wrote:

In java, I use the instanceof keyword to check if an object is a certain
type of class.

So you can do things like:
if (s instance of string) then output("String!!!") else output("Needs a
string")

Whats the equivalent in VBA?


I don't know Java, but I think you are looking for either the VarType or
TypeName function (they are similar, but one outputs a number representing
the data type and the other outputs the data type name as a String value).

Rick