maevasa
Messages postés100Date d'inscriptionvendredi 23 avril 2004StatutMembreDernière intervention 3 août 2004
-
28 juil. 2004 à 09:30
chaker327
Messages postés2Date d'inscriptiondimanche 20 juin 2004StatutMembreDernière intervention30 août 2005
-
30 août 2005 à 21:41
bonjour je souhaiterais encadrer des résultats et agrandir des cellules est ce que quelqu'un serait me dire comment
merci d'avance
Maeva
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();
}