D
David ROY
Dear all,
I'm trying to automate Excel 97 in Visual C++ (using the article "HOWTO :
Create Automation Project Using MFC and a TypeLibrary").
It works not so bad, but I have encountered 2 major problems :
- I can't manage to run a macro.
I'm using the code :
ExcelApp.Run( COleVariant( "test.xls!Macro1" ), COleVariant( (short) NULL ),
COleVariant( (short) NULL ),... ) ;
The active document is "Classeur1.xls" but "test.xls" is opened in read-only
mode. ExcelApp is obtained with
ExcelApp.CreateDispatch("Excel.Application") and it's good (i've filled in
some sheets)
- I can't manage to add a new sheet
I tried to use the Worskheets.Add() function, but I don't know how to fill
in the two first arguments ("before" and "after") and even if it compiles it
doesn't work.
Thanks in advance to anyone who could help me.
David
--
David ROY
ENSICA - Promotion 56
(e-mail address removed)
06.11.40.60.97
SOLID DYNAMICS
53, rue Albert Thomas
42300 ROANNE
Tel : 04.77.70.21.11
Fax : 04.77.70.87.00
"Méfiez-vous des rêves de jeunesse, ils finissent toujours par se réaliser."
Goethe
I'm trying to automate Excel 97 in Visual C++ (using the article "HOWTO :
Create Automation Project Using MFC and a TypeLibrary").
It works not so bad, but I have encountered 2 major problems :
- I can't manage to run a macro.
I'm using the code :
ExcelApp.Run( COleVariant( "test.xls!Macro1" ), COleVariant( (short) NULL ),
COleVariant( (short) NULL ),... ) ;
The active document is "Classeur1.xls" but "test.xls" is opened in read-only
mode. ExcelApp is obtained with
ExcelApp.CreateDispatch("Excel.Application") and it's good (i've filled in
some sheets)
- I can't manage to add a new sheet
I tried to use the Worskheets.Add() function, but I don't know how to fill
in the two first arguments ("before" and "after") and even if it compiles it
doesn't work.
Thanks in advance to anyone who could help me.
David
--
David ROY
ENSICA - Promotion 56
(e-mail address removed)
06.11.40.60.97
SOLID DYNAMICS
53, rue Albert Thomas
42300 ROANNE
Tel : 04.77.70.21.11
Fax : 04.77.70.87.00
"Méfiez-vous des rêves de jeunesse, ils finissent toujours par se réaliser."
Goethe