Posted on behalf of fred..

Here is the code : 

<CFSCRIPT>
/* Read excel file */
objWorkBook = objExcel.Workbooks;
objOpenedBook = objWorkBook.Open("#Attributes.FilePath#");
objSheet = objOpenedBook.ActiveSheet; 
objData = ObjSheet.Range("#Attributes.Range#");
objValue = ObjData.value;
</CFSCRIPT>
<!--- Delete the blanks --->
<cfloop index="i" from="1" to="#arrayLen(objvalue)#">
                <cfif objvalue[i][1] eq "">
                        <cfset temp = ArrayDeleteAt(objvalue,i)>    
                </cfif> 
</cfloop>


Im using com to read an excel file and store it into an 2 dim array
(cfscript code). When the excel field is blank I get an undefined
element. What seems strange is I can dump it and it will show the blanks
as undefined but when I try to loop through it (to try to delete the
blanks) it gives the error.

Thanks for your help.

Fred Lecul
Technical Services
Institutional and Business Services (IBS-IT)


-----Original Message-----
From: Adam Chapman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 23 December 2003 10:42 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Error with undefinded elements in an array


Hi Fred,

Can you post some code.. There are a few quirks
With removing arrays elements..

Cheers,
Adam

-----Original Message-----
From: Lecul, Fred [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 16, 2003 5:18 PM
To: CFAussie Mailing List
Subject: [cfaussie] Error with undefinded elements in an array


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to