Getting Started

Add-in Express™ Support Service
That's what is more important than anything else

Getting Started
Odd Error when using Excel Task Panes 
George Spears




Posts: 78
Joined: 2010-05-06
Hello,

Windows 7 64 bit, Office 2010... Delphi 2010
Just getting started here... be gentle <grin>

I have gone through the video demo and created an excel task pane (the demo where you create Excel, Word and PPT panes...) Everything works fine...

I add a button to my pane. I want to read data from the spreadsheet. It will need to read what is selected (there should just be one cell), but I am taking baby steps... so I am starting out just reading one specific cell.

procedure TadxExcelPane.BitBtn1Click(Sender: TObject);
begin
ShowMessage(ExcelApp.Cells.Value[1,1]);
end;


Compile/Register...
Run Excel...
Click my button

I get the error "No enough storage is available to complete the operation", which tells me something is really wrong...

What is it that I am doing wrong? I am NOT declaring ExcelApp anywhere, but it appears to be declared for me automatically. Is this accurate? Finally, how do I read the value of a selected cell?

Thanks
GS
Posted 08 Dec, 2011 09:03:15 Top
Andrei Smolin


Add-in Express team


Posts: 18791
Joined: 2006-05-11
Hello George,

In the help reference for the Excel Object Model, they say:

Returns a Range object that represents all the cells on the active worksheet. If the active document isn?Â?Ð?ét a worksheet, this property fails.


I suggest that you get ExcelApp.Selection and check if it returns an ExcelRange. Also, please check recent posts: http://www.add-in-express.com/forum/read.php?FID=1&TID=10214 and http://www.add-in-express.com/forum/read.php?FID=1&TID=10212.


Andrei Smolin
Add-in Express Team Leader
Posted 08 Dec, 2011 10:50:04 Top