Hi,

I've just stumbled across the COM problems in CFMX and have installed the
Update but nothing has changed with my COM problem. Its a simple call to the
Excel object to read a simple value and worked fine in CF4.5.2

I've even re-run wsconfig.jar on the server in an attempt to transfer the
*update* to the virtual sites.

My code, which worked fine in CF4.5 is below:
_________________________________________________
<cfset file="D:\datasource\finance.xls">
<!--- Try to connect to the Excel application object --->
<CFTRY>
    <!--- If it exists, connect to it --->
    <CFOBJECT
        ACTION="CONNECT"
        CLASS="Excel.Application"
        NAME="objExcel"
        TYPE="COM">
  <CFCATCH>
    <!--- The object doesn't exist, so create it --->
    <CFOBJECT
        ACTION="CREATE"
        CLASS="Excel.Application"
        NAME="objExcel"
        TYPE="COM">
  </CFCATCH>
</CFTRY>

<cfscript>
// Get the workbooks collection //
objBooks = objExcel.Workbooks;

// Open and activate the workbook //
objBook = objBooks.Open(File);
objBook.Activate();

// Get the sheets collection //
objSheets = objBook.WorkSheets;

// Get a named sheet //
objSheet = objSheets.Item("apr");

// Create the range and copy the records from ADO //
objRange = objSheet.Range("B2:B2");
objRange.Value=#quotation.term#;
objRange = objSheet.Range("C2:C2");
objRange.Value=-#monthlyadj#;
objRange = objSheet.Range("D2:D2");
objRange.Value=#loan_amt#;
objRange = objSheet.Range("E2:E2");
objRange.Value=#quotation.apr#/100;


// Save the file //
objSheet.SaveAs(File, Val(1));

// Kill the ADO and Excel objects //
objBook.Close();
</cfscript>
_________________________________________________

All this does is utilise Excel's APR calculation macro.

Although I may be able to figure a workaround to this particular issue
without using COM, I do have other applications which rely heavily on
connecting to Exchange using COM. Are there any other alternatives for
connecting to Exchange?

Many TIA

_____________________________________________
Dave Wilson
Chief Technology Officer
Integrated Auto Solutions Ltd

The Howard Building
155 Northumberland Street
Belfast BT13 2JF

t: +44 28 9024 3123
f: +44 28 9024 3124
e: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to