RE: Accessing Add'l Excel Functions
by Matt Grimaldi other posts by this author
Sep 25 2000 8:47AM messages near this date
Remove from mailing list
|
dbi error??
Perl Mongers [mailto:djasmine-pm@[...].com] wrote:
] I'm trying to insert a sheet into an existing wookbook using Win32::OLE.
] In VB, the command is Worksheets.Add count:=2, before:=Sheets(1)
] Is there an equivalent that I can use with Perl?
] Thanks for any help you can offer.
In Perl (and C++) Properties and methods are specified by using the "-> "
separator instead of the dot. Assuming you have previously in your script
created the OLE workbook object, let's say $xls, the command you asked
about would be:
$xls-> Worksheets->Add($before, $after, $count, $type)
With whatever necessary literal values plugged in the arguments.
If you're going to use $type you will need to figure out what the actual
numbers the constansts such as "xlWorksheet", "xlExcel4MacroSheet", and
"xlExcel4IntlMacroSheet" resolve to (I would guess 0, 1, 2, 3, ...)
Basically, use whatever object methods and properties are available,
but remember to use literal values instead of names of constants, though
OTOH, I suppose you could assign values to all the VB constants at the
beginning of your scripts
-- Matt Grimaldi
|