Brian, Sorry I've screwed up in my advice to you. I've suddenly remembered that my problems were down to attempting to use excel as a datasource, with an insert, then subsequent read of the newly calculated value. This resulted in similar symptons to your problem, whereby it worked first time round but subsequent calls simply returned a cached result.
Using COM to do the insert was my workaround to the problem, plus I used the disable dbconnections commands as an extra measure on the datasource before invoking a DTS package in SQL 7 to retrieve and record the relevant result. In which case the placement of the tags are actually BEFORE calling the sheet (as a datasource) with the DTS package. Your problem is that you appear to be experiencing excel locking up even when connecting via COM in the custom tag. I suspect you dont even have the sheet set up as a datasource. Sorry to have confused you, Dave -----Original Message----- From: Brian Ferrigno [mailto:[EMAIL PROTECTED]] Sent: 30 September 2002 17:48 To: CF-Talk Subject: RE: COM help Hi Dave, Sorry about being a pest but where exactly do you have to place the code you described below? I placed it after the call to the custom tag that creates the csv file. Does it need to be before or wrap around the call? <cf_excel2csv excelFileIn="C:\Inetpub\wwwroot\clients\mysite\import\uploads contracts2.xls" CSVFileOut="C:\Inetpub\wwwroot\clients\mysite\import\uploads\ExcelFile.txt"> > <CFSET CFUSION_DISABLE_DBCONNECTIONS("datasourcename", 1)> <CFSET CFUSION_DISABLE_DBCONNECTIONS("datasourcename", 0)> Thank you very much for the help. Brian -----Original Message----- From: Dave Wilson [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 12:13 PM To: CF-Talk Subject: RE: COM help Brian, Although I've experienced pretty much what you describe, I've never seen the process actually killing the CF Service itself. To fix the problem of inactivity in the excel part of the process on subsequent attempts, use the following: <CFSET CFUSION_DISABLE_DBCONNECTIONS("datasourcename", 1)> <CFSET CFUSION_DISABLE_DBCONNECTIONS("datasourcename", 0)> Which should help to kill any locked connections to the sheet. HTH, Dave -----Original Message----- From: Brian Ferrigno [mailto:[EMAIL PROTECTED]] Sent: 30 September 2002 16:40 To: CF-Talk Subject: COM help I need help tracking down an error in using CFOBJECT to create a csv file from an excel spreadsheet. I am using CF to open up an excel spreadsheet and then trying to turn the data into a csv file. The code i'm using works fine the first time the application is launched but on subsequent tries nothing happens. According to the company hosting my site COM is causing the CF service to fail then it has to be restarted. I'm listing the code i'm using below. Is this an issue with a patch needing to be installed or a problem with the code below? Any help would much appreciated. Thanks. -Brian Stats ------ CF version CF5.0 IIS Windows 2K server Code ---- <cftry> <cfobject action="CONNECT" class="Excel.Application" name="objExcel" type="COM"> <cfcatch> <cftry> <cfobject action="CREATE" class="Excel.Application" name="objExcel" type="COM"> <cfcatch type="Object"> Cannot create Excel Object <cfabort> </cfcatch> </cftry> </cfcatch> </cftry> <cftry> <cfscript> // this code will open up the excel spread sheet and then save it as a CSV file. // HTML file path ExcelFilePath = "#attributes.excelFileIn#"; // Destination path for new Word document // We leave off the extension since we'll declare the file type later on CSVFilePath = "#attributes.CSVFileOut#"; // Open Word in the background objExcel.Visible = false; // Disable alerts such as: 'Save this document?' objExcel.DisplayAlerts = false; // Get the 'Documents' collection objBooks = objExcel.workbooks; // Open the HTML document objBook = objBooks.Open(ExcelFilePath); // Get the sheets collection objSheets = objBook.WorkSheets; // Get the first sheet objSheet = objSheets.Item(Val(1)); // Get a named sheet objSheet = objSheets.Item("#attribtues.sheetName#"); /* Save it as a new document -- the extension will automatically be appended based on the file type we choose. Some of the file types to convert to: 1 = .xls 3 = .txt (tab delimetered 6 = .csv */ objSheet.SaveAs(CSVFilePath, Val(6)); // The next line would convert it to RTF instead // objSpreadSheet.SaveAs(CSVFilePath,Val(6)); // Close the document objBook.Close(); // Quit Word objExcel.Quit(); if (attribtues.showConfirmation EQ 1) { writeOutput("<font size=""-1"" face=""Verdana,Geneva,Arial,Helvetica,sans-serif""><b>File Created:</b> ""#attributes.CSVFileOut#"" <b>from file:</b> ""#attributes.excelFileIn#""<p></font>"); } </cfscript> <cfcatch> <!--- error creating file ---> <font face="Verdana,Geneva,Arial,Helvetica,sans-serif" size="-1">there was an error creating your new CSV filesfrom your Excel Spreadsheet</font> </cfcatch> </cftry> ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

