bonjour je souhaiterais encadrer des résultats et agrandir des cellules est ce que quelqu'un serait me dire comment
merci d'avance
Maeva
ps: le code que j'utilise sous visual c++ .net
#include <stdio.h>
#import "C:\Program Files\Microsoft Office\Office\MSO9.DLL" no_namespace rename("DocumentProperties","DocumentPropertiesXL")
//#import "C:\Program Files\Fichiers communs\Microsoft Shared\Office10\MSO.DLL" no_namespace rename("DocumentProperties","DocumentPropertiesXL")
#import "C:\Program Files\Fichiers communs\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB" no_namespace
#import "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB" rename("ExitWindows", "ExitWindowsWD") rename("DialogBox", "ExcelDialogBox") rename("RGB", "ExcelRGB") no_dual_interfaces
using namespace std;
int main()
{
// Initialize COM
CoInitialize(NULL);
try
{
Excel::_ApplicationPtr excel;
// Initialize Excel and make sure it's initialized
HRESULT hr = excel.CreateInstance(L"Excel.Application");
if(FAILED(hr))
{
char msg[1024] = {0};
sprintf(msg, "E: There was an error initializing Excel: %d", hr);
//throw std::runtime_error(msg);
}
excel->PutVisible (true);//Put it after instance is created.
Excel::_WorkbookPtr workbook = excel->Workbooks->Add(static_cast<long>(Excel::xlWorksheet)); // Create the workbook
Excel::_WorksheetPtr worksheet = excel->ActiveSheet; // Get the active sheet
worksheet->PutName ("Nom de la feuille");//
// This is how you put the values into the worksheet
worksheet->Range["A1"]->Value = "Hellofddddddddddddddddddddddd"; // Set a value
//worksheet->Columns["A:A"]->Resize = 56; // Set a value
worksheet->Range["A1:D1"]->Font->ColorIndex = 27L;
worksheet->Range["A2:D2"]->Interior->ColorIndex = 5L;
worksheet->SaveAs("c:\\test.xls"); // Save it
workbook->Close(); // Close the workbook
excel->Quit(); // Quit excel
}
catch(_com_error &ce)
{
// Handle the error
}
CoUninitialize();
}