close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 14 years ago

Closed 14 years ago

#1215 closed defect (fixed)

TolExcel Sheet selection functions behave imporperly

Reported by: jmdedios Owned by: Jorge
Priority: normal Milestone: TOL Packages
Component: Excel API Version: head
Severity: critical Keywords: Excel, worksheet
Cc:

Description

ActivateWS and ActivateNamedWS functions allways return 'True' value, even when the number or name of worksheet doesn't exist. If the worksheet doesn't exist, they print an error message like: 'ActivateNamedWS: no se ha posido establecer la hoja activa Alto Valor', but return 'True' instead of 'False'.

Attachments (1)

Capacidades_20100601.xls (4.1 MB) - added by jmdedios 14 years ago.

Change History (4)

Changed 14 years ago by jmdedios

Attachment: Capacidades_20100601.xls added

comment:1 Changed 14 years ago by jmdedios

Severity: normalcritical

In addition to the previous comment, there are excel documents that cannot be read with these functions. The excel attached is impossible to be read because the functions ActivateWS and ActivateNamedWS can only activate the first sheet. The following code opens the excel attached an activates the first sheet ("Resumen Tráfico") but it returns an error when trying to activate another one.
However, the code using the old version of the functions, activates all the sheets of the excel book.

#Require TolExcel;
TolExcel::@WorkBook wb = TolExcel::@WorkBook::Open( "c:/Temp/Capacidades_20100701.xls" );
Real resSelHoj = wb::ActivateNamedWS("Resumen Tráfico");
wb::ActivateNamedWS("Desarrollo");
Real resSelHoj = wb::ActivateWS(1);
wb::ActivateWS(2);
Real wb::Close(?);

Text XLSOpenExcel("c:/Temp/Capacidades_20100701.xls", 0);
Text XLSSelectWorksheetIndex(3);
Text XLSSelectWorksheetByName("Desarrollo");
Text XLSQuit(?);

comment:2 Changed 14 years ago by Jorge

Status: newaccepted

The second part of this ticket has being move to #1216

comment:3 Changed 14 years ago by Jorge

Resolution: fixed
Status: acceptedclosed

(In [3568]) fix #1215

Note: See TracTickets for help on using tickets.