Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

SpreadsheetLauncher.GetCLSID Method

Published: May 2010

Gets the class identifier (CLSID) of the SpreadsheetLauncher control.


expression.GetCLSID()

expression

An expression that returns a SpreadsheetLauncher object.

A String that contains the CLSID.

Use the CLSID value to construct an <OBJECT> tag to which Internet Explorer can bind calls.

This example uses the SpreadsheetLauncher.ImportList Method method to import data from a spreadsheet to a SharePoint site. After creating a SpreadsheetLauncher object, the example uses the GetCLSID method to construct an <OBJECT> tag for writing the object to the page.

<SCRIPT language="JavaScript">
SpreadsheetLauncherButton = new ActiveXObject("SharePoint.SpreadsheetLauncher.2");

if (SpreadsheetLauncherButton) {
   var launcherCLSID = SpreadsheetLauncherButton.GetCLSID();
   var objectTag = '<OBJECT classid="clsid:' + launcherCLSID + '" 
      id="SpreadsheetLauncherObj" style="display:none;"></OBJECT>';

   document.write(objectTag); }

function DoImportSpreadsheet(){
   var form = document.frmNewList;
   var resultUrl;

   resultUrl = SpreadsheetLauncherObj.ImportList(form['List'].value," ", false, 'http://STSServer1/_vti_bin/owssvr.dll?CS=109&');
   window.parent.location.assign(resultUrl);
   return false;}
</SCRIPT>

The previous example assumes the existence of a form such as the following, which calls the DoImportSpreadsheet function and passes several INPUT values to the server.

<FORM name="frmNewList" onsubmit="return DoImportSpreadsheet();">
   <INPUT type="Text" title="Name" name="List" maxLength="255">
   <INPUT type="File" name="SpreadsheetFile" style="behavior: 
      url(#SpreadsheetLauncherObj);">
   <INPUT type="Hidden" name="ListTemplate" value='SpreadsheetImport'>
   <INPUT type="Submit" value="Import">
   <INPUT type="Hidden" name="Project" value="ows">
   <INPUT type="Hidden" name="Cmd" value="NewList">
</FORM>

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.