Computing.Net > Forums > Web Development > Jscript Excel PasteSpecial

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Jscript Excel PasteSpecial

Reply to Message Icon

Name: darkhalf
Date: June 2, 2006 at 08:41:57 Pacific
OS: redhad (8,9) mandrake (8.
CPU/Ram: athalon
Comment:

Hi,

I'm trying to do some automation of Excel through Jscript, but I keep getting an error in regards to when I try to pastespecial (PasteSpecial method of Range class failed). Any help would be great...

<script type="text/javascript">
var objXl, ws;
function test()
{
objXl = new ActiveXObject("Excel.Application");
objXl.Visible = true; //set to TRUE for debugging
objXl.WorkBooks.open(document.forms[0].tFile.value);
ws = objXl.ActiveSheet;

var xlPasteValues = -4163;
var xlPasteSpecialOperationNone = -4142;
var xlPasteFormulas = -4123;
var total = ws.UsedRange.Rows.Count;

ws.Range("C2").value = "=concatenate(A2,\" \",B2)";
ws.Range("C2").Copy();
ws.Range("C2:C"+total).Select();
// ws.PasteSpecial(); <- works but copies the formula
// ws.PasteSpecial(xlPasteValues,xlPasteSpecialOperationNone,false,false); <- doesn't work, but this is what I need to work...
}
</script>



Sponsored Link
Ads by Google

Response Number 1
Name: bakss
Date: August 9, 2006 at 07:39:14 Pacific
Reply:

use server side code(php or asp)


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Jscript Excel PasteSpecial

Excel on asp.net www.computing.net/answers/webdevel/excel-on-aspnet/731.html

Extract Excel Data With ASP www.computing.net/answers/webdevel/extract-excel-data-with-asp/2113.html

Excel charts in dreamweaver www.computing.net/answers/webdevel/excel-charts-in-dreamweaver/2154.html