Skip to content

Instantly share code, notes, and snippets.

@huguogang
Created April 22, 2011 01:13
Show Gist options
  • Save huguogang/935826 to your computer and use it in GitHub Desktop.
Save huguogang/935826 to your computer and use it in GitHub Desktop.
<cffunction name="createExcelObj" access="public" returntype="any" output="false" >
<cfset var oExcel = "">
<CFOBJECT ACTION="CREATE" CLASS="Excel.Application" NAME="oExcel" TYPE="COM">
<cfscript>
//remove all interactions
oExcel.AlertBeforeOverwriting = false;
oExcel.AskToUpdateLinks = false;
oExcel.PromptForSummaryInfo = false;
oExcel.Visible = false;
oExcel.DisplayAlerts = false;
</cfscript>
<cfreturn objExcel>
</cffunction>
<cffunction name="createExcelObj" access="public" returntype="any" output="false" >
<cfset var oExcel = "">
<CFTRY>
<CFOBJECT ACTION="CREATE" CLASS="Excel.Application" NAME="oExcel" TYPE="COM">
<cfscript>
//remove all interactions
oExcel.AlertBeforeOverwriting = false;
oExcel.AskToUpdateLinks = false;
oExcel.PromptForSummaryInfo = false;
oExcel.Visible = false;
oExcel.DisplayAlerts = false;
</cfscript>
<cfreturn objExcel>
</cffunction>
<cffunction name="createExcelObj" access="public" returntype="any" output="false" >
<cfset var oExcel = "">
<CFTRY>
<CFOBJECT ACTION="CREATE" CLASS="Excel.Application" NAME="oExcel" TYPE="COM">
<cfscript>
//remove all interactions
oExcel.AlertBeforeOverwriting = false;
oExcel.AskToUpdateLinks = false;
oExcel.PromptForSummaryInfo = false;
oExcel.Visible = false;
oExcel.DisplayAlerts = false;
</cfscript>
<cfreturn objExcel>
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment