
Controlling Excel via JScript
Hi Richard, Thank you for the reply... Here is what I am
trying to do and the following code. I am copying the
contents of a web page and opening Excel locally. I then
paste the contents of the web site into excel. I can get
the contents into excel but it comes through with
hyperlinks etc. I would like to add an additional
copy/paste but using the Paste Special function with
the "paste as formulas" parameter which would then remove
the hyperlinks and formatting. I just can't get the
syntax and can't find any reference.
Here is my script:
<SCRIPT language="JavaScript">
function bringToExcel()
{
this.document.execCommand("SelectAll", false);
this.document.execCommand("Copy", true);
this.document.execCommand("UnSelect", false);
// Start Excel and get application object.
var oXL = new ActiveXObject("Excel.Application");
oXL.Visible = true;
// Get a new workbook.
var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
oSheet.Paste();
oXL.Selection.Copy();
oSheet.Paste();
// oXL.Selection.PasteSpecial
("xlFormulas,xlNone,False,False"); Can't get the syntaX!!
oXL.Visible = true;
oXL.UserControl = true;
}
</SCRIPT>
Thanks again
Dave
Quote:
>-----Original Message-----
>Hi Dave, I've done a bit of report creation and other
manipulation of Excel
Quote:
>in WSH, let me know what you need to know (what you're
having trouble with)
Quote:
>and I'll try to post a relevant example.
>Richard
>> All, I am writing a script and creating an ActiveX
control
>> to launch excel on user's desktop and do some copy paste
>> special functions. I am having a heck of a time trying
to
>> find the correct syntax for the Excel document model for
>> use with Jscript. Does anyone know reference materials
on
>> the MS site or a good book to use as reference?
>> Thank you in advance.
>> Dave
>.