Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call a makro via COM?

Status
Not open for further replies.

raphi

IS-IT--Management
Mar 12, 2003
2
US
I want to call an Excel-Makro in my Coldfusion-Template.
How do I do this ???I tried evrything to run it, but now way, it all didn't help.
Has anyone an idea, I'd be very thankful.
May I use the Run-method or may I use the Execute-methode and do I have to give them Parameters with and when yes, which ones?

here's the code I've tried to run:



<cfset DBPath=&quot;#request.RootPath#TestMappe2.xls&quot;>
<cfset sheetname=&quot;20001204&quot;>
<!--- set the parameter for the excel file connection --->
<cfset dsn=&quot;DRIVER={Microsoft Excel Driver (*.xls)};DBQ=#DBPath#;FIL=MSExcel&quot;>
<!--- try to connect to this com object --->


<cfobject type=&quot;COM&quot; name=&quot;xls&quot; class=&quot;ADODB.Connection&quot; action=&quot;CREATE&quot;>


<cfscript>
objWorkBook = xls.Workbooks;
objOpenedBook = objWorkBook.Open(DBPATH);
objWorkSheets = xls.WorkSheets;
objAction = xls.execute(&quot;Run(['makro'],['chart'],['TheChart']&quot;)
objWorkBook.Close();
xls.Quit();
</cfscript>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top