1

Topic: Data writing in Ms Excel (access obtaining to Excel)

Good afternoon. I want to get access to the current open document (book) MS Excel. Clearly how to open the book from a file and how to create the new book. And how to get access to current, already open book that already in it to do data writing? Whether really such?

2

Re: Data writing in Ms Excel (access obtaining to Excel)

Hello, emergenter, you wrote: E> Good afternoon. I want to get access to the current open document (the book) MS Excel. E> it is clear how to open the book from a file and how to create the new book. And how to get access to current, already open book that already in it to do data writing? Whether really such? GetActiveObject (CLASS_ExcelApplication, nil, unk) var unk: IUnknown; xl: ExcelApplication; xlWb: ExcelWorkbook; xlSh: ExcelWorksheet; i, j: Integer; m: TMenuItem; begin Assert (Assigned (Menu), ' {4729A6A2-C2A4-4C1E-B867-6A3A885D275C} '); Assert (Assigned (Items), ' {EE2EF752-B6C6-4662-AB15-E29FEE06D096} '); NewCursorGuard (); Items. Clear;//we clear menu Holders. Clear;//we clear containers try//it is worked only with the active copy, I do not know as to receive ALL  if Succeeded (GetActiveObject (CLASS_ExcelApplication, nil, unk)) then try if Supports (unk, ExcelApplication, xl) then for i: = 1 xl. Workbooks. Count do begin//it is important, with 1 xlWb: xl. Workbooks {.Item} [i];

3

Re: Data writing in Ms Excel (access obtaining to Excel)

Hello, glh, you wrote: glh> Hello, emergenter, you wrote: E>> Good afternoon. I want to get access to the current open document (the book) MS Excel. E>> it is clear how to open the book from a file and how to create the new book. And how to get access to current, already open book that already in it to do data writing? Whether really such? glh> GetActiveObject (CLASS_ExcelApplication, nil, unk) glh> glh> var glh> unk: IUnknown; glh> xl: ExcelApplication; glh> xlWb: ExcelWorkbook; glh> xlSh: ExcelWorksheet; glh> i, j: Integer; glh> m: TMenuItem; glh> begin glh> Assert (Assigned (Menu), ' {4729A6A2-C2A4-4C1E-B867-6A3A885D275C} '); glh> Assert (Assigned (Items), ' {EE2EF752-B6C6-4662-AB15-E29FEE06D096} '); glh> NewCursorGuard (); glh> Items. Clear;//we clear the menu glh> Holders. Clear; //we clear containers glh> try glh>//it is worked only with the active copy, I do not know as to receive ALL  glh> if Succeeded (GetActiveObject (CLASS_ExcelApplication, nil, unk)) then glh> try glh> if Supports (unk, ExcelApplication, xl) then glh> for i: = 1 xl. Workbooks. Count do begin//it is important, with 1 glh> xlWb: xl. Workbooks {.Item} [i]; glh> it on PASCAL! And on with ++ is ? ( all Internet also did not find!)

4

Re: Data writing in Ms Excel (access obtaining to Excel)

5

Re: Data writing in Ms Excel (access obtaining to Excel)

Hello, emergen, you wrote: E> it on PASCAL! And on with ++ is ? ( all Internet also did not find!) well it is fine. https://msdn.microsoft.com/ru-ru/librar … p/ms221467 (v%3Dvs.85).aspx

6

Re: Data writing in Ms Excel (access obtaining to Excel)

Hello, glh, you wrote: glh> Hello, emergen, you wrote: E>> it on PASCAL! And on with ++ is ? ( all Internet also did not find!) glh> well it is fine. glh> https://msdn.microsoft.com/ru-ru/librar … p/ms221467 (v%3Dvs.85).aspx It for With ++! And how for  QT such miracle will look?

7

Re: Data writing in Ms Excel (access obtaining to Excel)

Hello, emergenter, you wrote: E> Hello, glh, you wrote: glh>> Hello, emergen, you wrote: E>>> it on PASCAL! And on with ++ is ? ( all Internet also did not find!) glh>> well it is fine. E> It for With ++! And how for  QT such miracle will look? The dude, you it...