ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved