Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2006, 01:26 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
Default javascript automating through excel...

Hi,

I don't know if this is in the wrong section, but I figure it's more javascript than excel VBA...

I'm trying to mess around changing the background, foreground color... Now the following code will open the excel sheet, and as per http://msdn.microsoft.com/library/de...ShapeRange.asp, the ws.Cells line should be able to change the color... Now the issue is that when I try it I get "Unable to set the Color property of the Font class", and if I try it with the "RGB(170, 170, 170)", I get no object, which I'm assuming is because it's looking for a function called RGB... Any help would be great...

function startup()
{
    fileLoc = document.forms[0].fName.value;
    if (objXls == null)
    {
        objXls = new ActiveXObject("Excel.Application");
        objXls.Visible = true;
        objXls.WorkBooks.open(fileLoc);
        ws = objXls.ActiveSheet;
    }
    ws.Cells(1,1).Font.Color = "#cccccc"; // "RGB(170, 170, 170)";
}






Similar Threads
Thread Thread Starter Forum Replies Last Post
convert Excel formula to JavaScript amwith Javascript How-To 3 March 7th, 2008 06:31 AM
Automating Excel from Access Zaff VB.NET 2002/2003 Basics 6 May 11th, 2006 09:02 AM
excel sheet used in javascript ayppa Excel VBA 1 August 19th, 2004 01:14 PM
Excel automating problem xwang4 Excel VBA 3 September 19th, 2003 01:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.