function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Create a custom button to export an enquiry into an excel format - having issues with ActiveX



From: David Bellew []
Sent: 01 March 2010 07:44
Subject: Case #03344005: Unable to use ActiveX in a custom button [ ref:00D062.50037rpye:ref ]


Dear Priyank,

Unfortunately code development is not supported by the Technical Support Team.

It is recommended that users visit the Developers forum for assistance in such issues.

Best regards,
David Bellew

Want to tell us about your support experience?

You may be sent a customer satisfaction survey in a few days, please complete this as we value your feedback.

------ Your Question/Comment ------


I am trying to create a custom button which will execute JavaScript. In the Javascript code I am using ActiveX to read/write files on the user's desktop. I am trying this out from IE8. However, the button is giving me an error: "A problem with the OnClick JavaScript for this button or link was encountered: Automation server can't create object".

Can you please help how I can get this to work?

Basically, I am trying to provide the client with a functionality to generate a document from his opportunity.


Have the custom button load an external URL (even a visualforce page if needed) and then have that page load whatever tools you need.   You can also then have that window close itself automaticly.



Thanks for the response. I was able to get the ActiveX stuff to work by relaxing the security settings on my IE. However, I am having trouble using the salesforce fields in my Javascript. Here is the code I am using:


var xls = new ActiveXObject("Excel.Application");
xls.visible = true;
xls.Cells( 1, 1).Value = "Opportunity Number";
xls.Cells( 1, 2).Value = "{!Opportunity.Opportunity_Number__c}";
xls.Cells( 2, 1).Value = "Opportunity Name";
xls.Cells( 2, 2).Value = "{!Opportunity.Name}";


I am not able to get the opportunity number and name to come up correctly.

What am I doing wrong here???