Recent

Author Topic: office automation??  (Read 36043 times)

jmLandsvik

  • New Member
  • *
  • Posts: 29
Re: office automation??
« Reply #30 on: May 11, 2011, 04:15:20 pm »
Hi all...

What is the status of this today ???

I too found this page:  :)
http://wiki.lazarus.freepascal.org/Office_Automation#Using_the_Free_Pascal_Spreadsheet_Library

And I would agree with thales, not too userfriendly.  :-\

downloaded ExcelInterface V0.4 from this link (down the page)
http://tcoq.free.fr/composants.html
and after fixing some hardcoded filenames, it ran, AND worked... 8)

THEN, I took the example code below:(Cut/paste from the OA page)
Code: [Select]
// Initializing the common excel workbook:
 ExcelApp := TExcelApplication.Create(nil);
 ExcelApp.Active := True;
 ExcelApp.Visible := True;
 ExcelWbs := ExcelApp.WorkBooks;
 ExcelWb := ExcelWbs.Open( TestFileName)
 ExcelSheets := ExcelWb.Sheets;
 ExcelSheet1 := ExcelSheets.Sheet('Sheet1');

And it opens an excel workbook for me... :)
Then, preceeding with... (again, cut/paste from the OA page)

Code: [Select]
// adding a value
 aCell := aSheet.Cells(1, 1);
 aCell.Value := 10;

And we have ourself an instant crash... >:(
"Project excelTEST.exe raised exception class 'External: SIGSEGV'."

(Running:
 MS Office 2010
 Lazarus 0.9.31
/)

I have also tryed to install fpspreadsheet, but after compiling/installing, I can't see any difference, except for under [Additional], where I have TsWorksheetGrid. (perhaps it did not install right?)

tnx
Jan Magne

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2496
Re: office automation??
« Reply #31 on: May 12, 2011, 11:18:16 am »
Code: [Select]
// adding a value
 aCell := aSheet.Cells(1, 1);
 aCell.Value := 10;

And we have ourself an instant crash... >:(
"Project excelTEST.exe raised exception class 'External: SIGSEGV'."

I don't know the code, but the first thing I would look is if aSheet is not nil and second if it returned aCell.
(assuming aSheet and aCell are objects and not variants)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7499
Re: office automation??
« Reply #32 on: May 12, 2011, 03:25:02 pm »
Also I would use 2.5.1 with COM as much as possible. Many COM related fixes couldn't be merged back.

mica

  • Full Member
  • ***
  • Posts: 192
Re: office automation??
« Reply #33 on: May 12, 2011, 06:03:56 pm »
you can take a look at this componenet:

http://avemey.com/zexmlss/index.php