I am trying to output my data ino an excel spreadsheet and need to do
some formatting such as deleting some empty tabs, but my pages wide /
pages tal portion is not working properly. Does anyone know how to do
it? Is there a DDE Excel reference or chat sheet anywhere?
Here is what I have
%macro openExcel;
options xmin noxwait noxsync missing=0;
x 'cd c:\program files\microsoft office\office';
x 'excel';
data _null_;
x=sleep(7);
run;
Filename cmds dde 'excel|
system';
data _null_;
File cmds;
put '[WORKBOOK.DELETE("Sheet2")]';
put '[WORKBOOK.DELETE("Sheet3")]';
put '[WORKBOOK.TAB.SPLIT(0.1)]';
put '[WORKBOOK.DELETE("Sheet2")]';
put '[WORKBOOK.PAGESETUP.FitToPagesWide("1")]';
put '[WORKBOOK.PAGESETUP.FitToPagesTall("5")]';
run;
%mend openExcel;
%openExcel;
|
|
0
|
|
|
|
Reply
|
Andres
|
12/13/2010 2:01:23 PM |
|
Andres,
Three suggestions:
Download a file called macrofun.exe from Microsoft:
http://support.microsoft.com/kb/128185
Look at Koen Vyverman's papers and macros:
http://www.sas-consultant.com/professional/papers.html
Look at Nate Derby's macros: http://www.nderby.org/software.html
HTH,
Art
------------
On Dec 13, 9:01=A0am, Andres Lessing <aless...@gmail.com> wrote:
> I am trying to output my data ino an excel spreadsheet and need to do
> some formatting such as deleting some empty tabs, but my pages wide /
> pages tal portion is not working properly. =A0Does anyone know how to do
> it? =A0Is there a DDE Excel reference or chat sheet anywhere?
>
> Here is what I have
>
> %macro openExcel;
> =A0 =A0 options xmin noxwait noxsync missing=3D0;
> =A0 =A0 x 'cd c:\program files\microsoft office\office';
> =A0 =A0 x 'excel';
>
> =A0 =A0 data _null_;
> =A0 =A0 =A0 =A0 x=3Dsleep(7);
> =A0 =A0 run;
>
> =A0 =A0 Filename cmds dde 'excel|
> system';
> =A0 =A0 data _null_;
>
> =A0 =A0 =A0 =A0 =A0 =A0 File cmds;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 put '[WORKBOOK.DELETE("Sheet2")]';
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 put '[WORKBOOK.DELETE("Sheet3")]';
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0put '[=
WORKBOOK.TAB.SPLIT(0.1)]';
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 put '[WORKBOOK.DELETE("Sheet2")]';
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 put '[WORKBOOK.PAGESETUP.FitToPagesWide("=
1")]';
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 put '[WORKBOOK.PAGESETUP.FitToPagesTall("=
5")]';
> =A0 =A0 run;
> %mend openExcel;
>
> %openExcel;
|
|
0
|
|
|
|
Reply
|
art297
|
12/13/2010 3:12:06 PM
|
|