Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Issues with CFOBJECT (com), downloading data from SQL to Excel.

Community Beginner ,
Oct 29, 2010 Oct 29, 2010

Hello,

I am trying to download the data from SQL 2005 to 2000 excel and it is giving me following errors. (code is added below)

Please note that I have both Excel 2000 and Excel 2007 installed on my machine. (using Cold Fusion 7.0)

Is there anything I am doing wrong in the code.? Any quick help to resolve this issue would be really appreciated.

1) An exception occurred when executing a Com method. 

The cause of this exception was that: AutomationException: 0x800706ba -

2) An exception occurred when accessing a Com object field at line #17 (Code is : objWorkbooks = objExcel.Workbooks;)

3) An exception occurred when executing a Com method at line #17 (Code is : <cfset objExcel.Quit()>)

4) [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Excel Driver] Could not find installable ISAM.

I have coldfusion-70-updater2-win.exe as the latest update. Do I need to install updater 3 for the above error and where can i get the updater3.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Code

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<cftry>
<cfobject action="CONNECT" class="Excel.Application" name="objExcel" type="COM">                        
<CFSET DEBUG_STEP_STR = "1">               
<cfcatch>
     <cftry>
               <cfobject action="CREATE" class="Excel.Application" name="objExcel" type="COM">
               <CFSET DEBUG_STEP_STR = "1">
               <cfcatch type="Any">
                      <cfabort showerror="Error Message">                    
               </cfcatch>                              
       </cftry>                                        
   </cfcatch>
</cftry>

<CFTRY>
<CFSCRIPT>
     objWorkbooks = objExcel.Workbooks;
     objWorkbook = objWorkbooks.Open(#FILE_TEMPLATE#);
     objWorkbook.Activate();
     DEBUG_STEP_STR = "2";
     
     objWorksheets=objWorkbook.WorkSheets;
     objWorksheet = objWorksheets.Item("test1");
     objWorksheet = objWorksheets.Item("test2");                                                  
                         
</CFSCRIPT>
<cfset objWorksheet.SaveAs("#FILE_SAVEASPATH#", Val(1))>
<cfset objWorkbook.Close()>
<cfset objWorkbook     = "Nothing">
<cfset objExcel.Quit()>               
<cfset objExcel = "Nothing">

TOPICS
Advanced techniques
812
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 01, 2010 Nov 01, 2010
LATEST

Is there any help on this issue? Please let me know.

I have un-installed all the previous versions of excel and re-installed Excel 2007 and getting the following errors

1) An exception occurred when accessing a Com object field.

2) The selected method Quit was not found.


THANKS in advance.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources