Advertisement
perjespersson

EXCEL

Sep 23rd, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1.  
  2. https://docs.microsoft.com/en-us/office/troubleshoot/office-developer/automate-excel-from-visual-c
  3.  
  4.  
  5. using namespace Microsoft::Office::Interop::Excel;
  6. #define Excel Microsoft::Office::Interop::Excel
  7.  
  8. ////////////////////////////////////////////////////////////////////
  9. Excel::Application^ oXL;
  10. Excel::_Workbook^ oWB;
  11. Excel::_Worksheet^ oSheet;
  12. Excel::Range^ oRng;
  13.  
  14. oXL = gcnew Excel::Application();
  15. oXL->Visible = true;
  16.  
  17.  
  18. oWB = (Excel::_Workbook^)(oXL->Workbooks->Add(Type::Missing));
  19. oSheet = (Excel::_Worksheet^)oWB->ActiveSheet;
  20.  
  21.  
  22. oSheet->Cells[1, 1] = "Lasse";
  23. oSheet->Cells[1, 2] = "GΓΆran";
  24. ////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement