simoes | Hello,
J'ai un petit problème! J'ai créer un appli avec un objet "OleContainer" contenant une feuille excel à l'intérieur. Mais il m'est impossible d'écrire dedans celle-ci. J'ai réussi à créer un nouveau document excel, mais c'est excel mais je ne veux pas que excel s'ouvre et crée un nouveau document! Juste écrire dans la feuille de mon appli
A mon avis c'est dans les premières ligne qui il y a un problème! Merci
Code :
- // Crée une instance
- Variant vMSExcel;
- vMSExcel = Variant::CreateObject("Excel.Application" );
- vMSExcel.OlePropertySet("Visible", true);
- // Crée un nouveau Classeur
- Variant vXLWorkbook, vXLWorkbooks;
- vXLWorkbooks = vMSExcel.OlePropertyGet("Workbooks" );
- vXLWorkbook = vXLWorkbooks.OleFunction("Add" );
- // Séléction de la bonne feuille
- Variant vWorksheet;
- vWorksheet = vXLWorkbook.OlePropertyGet("Worksheets","Feuil1" );
- // Cellule Nom du logiciel
- Variant vCell;
- vCell = vWorksheet.OlePropertyGet("Range", "A1" );
- vCell.OlePropertySet("Value", "Nom du Logiciel" );
- vCell.OlePropertySet("ColumnWidth",40);
- vCell.OlePropertyGet("Font" ).OlePropertySet("Size",11);
- vCell.OlePropertyGet("Font" ).OlePropertySet("Bold",true);
|
|