Date: Thu, 31 Jul 2008 10:35:59 -0700
Reply-To: d-dubs <m.denniswilliams@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: d-dubs <m.denniswilliams@GMAIL.COM>
Organization: http://groups.google.com
Subject: SAS OLE for MS Excel
Content-Type: text/plain; charset=ISO-8859-1
I am trying to apply formating to a Excel file using OLE.
I am able to use the font to create a bold font.
But not able to change the Column Width and also the Background color.
I tried creating Excel macros to do the same thing and tried to
implement it in sas but I am not successful yet.
Could someone help me in the syntax for ColumnWidth and
BackgroundColor using "call send".
APPLYFORMATS:
call send(excelobj,'_GET_PROPERTY_','ActiveSheet',
wsobj );
call send (wsobj, '_get_property_', 'range', 'a1', 'cv1',
rng);
call send (rng, '_get_property_', 'font',
font);
call send (font, '_set_property_', 'FontStyle', 'Bold');
call send (wsobj, '_get_property_', 'range', 'a1','a25',
rng2);
call send (rng2, '_get_property_', 'ColumnWidth', 20);
return;
/********************************************************************/
log:
ERROR: Invalid argument.
Arguments passed to SEND:
1 rng2 = 4501
2 (Character Literal) = '_get_property_'
Parameters passed to SEND ENTRY:
1 (Character Literal) = 'ColumnWidth'
2 (Numeric Literal) = 20
Program returning prematurely at line 46
AF Program: _0000001.NEW.NEW.SCL
|