Restart your CF service, you probably ran the template once already
had a bug in code and the CFM template ended without closing
everything down.
Adam H
On Tue, 1 Feb 2005 13:43:12 -0800 (PST), Bobby Heath
<[EMAIL PROTECTED]> wrote:
> I am creating a com object in order to get the name of the worksheet in an
> excel file that I am importing. When I go to read the excel file using a
> dynamic datasource I am getting a error that says the file I am trying to
> access is open exclusively by another user. Does anybody know how I would
> release this file so I can run a query on it? Here is what I have:
>
> <cfscript>
> //create a com connection if it is not there already
> try{
> eobj.connect();
> }
> catch(Any excpt){
> eobj = CreateObject('com','Excel.Application');
> }
> books = eobj.Workbooks;
> Book = books.Open("#cffile.ServerDirectory#\#cffile.ClientFile#");
> Book.Activate();
> Sheets = Book.WorkSheets;
> //Get the name of the first Worksheet
> Sheet = Sheets.Item(Val(1));
> sheetname = sheet.Name;
> </cfscript>
> //Then I run the query on the file
> <cfquery name=whatever datasource=dynamicXLS >
> SELECT *
> FROM [#sheetName#$]
> IN '#cffile.serverdirectory#\#cffile.clientfile#' 'EXCEL 5.0;'
> </cfquery>
>
> Any help would be greatly appreciated.
>
> Thank You,
> Bobby L. Heath
> Coldfusion Developer
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192740
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54