Hi
Folks,
I need some help
with getting around the 255 sheet limit for NEW workbooks in Excel. Here is a
snippet from the book "Excel: The Missing Manual"
Note: Although you're limited to 255 sheets in a new workbook, Excel doesn't limit how many worksheets you can add after you've created a workbook. The only factor that ultimately limits the number of worksheets your workbook can hold is your computer's memory. However, most modern day PCs can easily handle even the largest of workbooks.
I've tried closing and and immediately reopening a Workbook, to no avail.
My system has 1 Gig of memory. No other apps are
running.
I keep a running count of the number worksheet's I've created in my Perl
script, and no matter whether I've closed and reopened, or what, as soon as
the count gets to 256 worksheets, the following error
occurs:
D:\Perl>perl CsaaRetrieveToTemplate.pl > outputA3_for_lv.txt
OLE exception from "Microsoft Excel":Unable to get the Copy property of the Worksheet classWin32::OLE(0.1701) error 0x800a03ec
in METHOD/PROPERTYGET "Copy" at CsaaRetrieveToTemplate.pl
line 976.
Here is a
snippet of the code ( the last line is throwing the above error
)
#
******************************************************************************************************
my
$templateCopy = "<Hierarchy
Member>";
$templateSheet = $Template_Workbook->Worksheets("$templateCopy");
$templateSheet->Activate();
my $shCount = $Template_Workbook->Worksheets->{Count};
print "shCount = $shCount\n";
$templateSheet->Copy({After=>$Template_Workbook->Worksheets($shCount)}) or die Win32::OLE->LastError();
$templateSheet = $Template_Workbook->Worksheets("$templateCopy");
$templateSheet->Activate();
my $shCount = $Template_Workbook->Worksheets->{Count};
print "shCount = $shCount\n";
$templateSheet->Copy({After=>$Template_Workbook->Worksheets($shCount)}) or die Win32::OLE->LastError();
#
*******************************************************************************************************************************************************
I hope
someone has a solution... this is a "show stopper" for the work I'm
doing.
Thanks in
advance for any help...
Glen
Plantz
_______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
