ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   automation object type library reference (https://www.excelbanter.com/excel-programming/305898-automation-object-type-library-reference.html)

Kevan Hanson

automation object type library reference
 
I am having trouble guessing the data type of some of the
automation functions. I am controlling Excel from a C++
app using excel.exe to create wrapper classes for
Application, Workbooks etc.

example: in C++ the Sheets.SaveAs code reguires before,
after, count, etc as arguments. I know what they all mean
from the VBA object model help; but are they shorts, longs
etc to cast the colevariant you have to use??

Does anyone know where I can get hold of an online
reference so I can look these things up quickly???

Regards,
Kevan

Tom Ogilvy

automation object type library reference
 
the help file in Excel VBA shows all the arguments to be variant.

--
Regards,
Tom Ogilvy

"Kevan Hanson" wrote in message
...
I am having trouble guessing the data type of some of the
automation functions. I am controlling Excel from a C++
app using excel.exe to create wrapper classes for
Application, Workbooks etc.

example: in C++ the Sheets.SaveAs code reguires before,
after, count, etc as arguments. I know what they all mean
from the VBA object model help; but are they shorts, longs
etc to cast the colevariant you have to use??

Does anyone know where I can get hold of an online
reference so I can look these things up quickly???

Regards,
Kevan




kevan hanson

automation object type library reference
 
In VBA thats the case, however in c++ if you initialize an
application object as "oExcel" for example, then the
following code references a WorkBook (provided oBook and
oBooks have been initialized).

oBook = oBooks.get_Item(COleVariant((short)1));

whereas

oBook = oBooks.get_Item(COleVariant((double)1));



fails, (obvious: but some are not; I was in a hurry) what
I am trying to find is a reference that indicates what
data type each argument is supposed to be. I know one
exists because I have seen it before, but not needed it
until now.

thanks for the reply.

Regards,
Kevan




-----Original Message-----
the help file in Excel VBA shows all the arguments to be

variant.

--
Regards,
Tom Ogilvy

"Kevan Hanson" wrote in message
...
I am having trouble guessing the data type of some of

the
automation functions. I am controlling Excel from a C++
app using excel.exe to create wrapper classes for
Application, Workbooks etc.

example: in C++ the Sheets.SaveAs code reguires before,
after, count, etc as arguments. I know what they all

mean
from the VBA object model help; but are they shorts,

longs
etc to cast the colevariant you have to use??

Does anyone know where I can get hold of an online
reference so I can look these things up quickly???

Regards,
Kevan



.



All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com