Newbie Q: Accessing Excell Cells

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

Newbie Q: Accessing Excell Cells
How to access Cells in Excel 
George Spears




Posts: 79
Joined: 2010-05-06
New to Add In Express... Unable to find any example of HOW to access data once the plug in is defined...
For example, I am playing around with an Excel plug in. I have added a Ribbon, with a button. The button calls code, which is being executed. If I wanted to read the value of a cell in the active worksheet, how do I do it?

With COM programming, I should be able to state...
ExcelApp.Cells[2, 1].Value := 'abc'

but .Value is no longer recognized.

What am I missing?

Thanks
Posted 09 Sep, 2014 12:28:33 Top
Andrei Smolin


Add-in Express team


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

The construct above will compile and work correctly. Code Completion doesn't work for the ".Value" part because the ExcelRange._Default property returns an OleVariant:

property _Default[RowIndex: OleVariant; ColumnIndex: OleVariant]: OleVariant

See e.g.

http://www.add-in-express.com/forum/read.php?SHOWALL_1=1&FID=1&TID=3105&1=&3105=#nav_start
http://www.add-in-express.com/forum/read.php?FID=1&TID=2567&MID=11853#message11853


Andrei Smolin
Add-in Express Team Leader
Posted 10 Sep, 2014 02:34:25 Top
George Spears




Posts: 79
Joined: 2010-05-06
Can I suggest a new demo? Your tool is awesome, but its value is its interface to the MS application. Most demos are using your tool, not both aspects. It would be nice to have a demo for Excel (for Example);
It adds a command ribbon with some buttons...
The buttons do various things...
1). Open a task pane
2). Read the currently selected cell
3). Add / copy / delete a worksheet
4). Copy data from one cell to an adjacent cell
5). Get the Excel version number.
6). Change all text to bold

etc...

Thank you
Posted 10 Sep, 2014 07:03:05 Top
Andrei Smolin


Add-in Express team


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

Thank you for the suggestion. Unfortunately, creating such a project is a thankless task. Implementation details can be project-specific. That is, implementing just any given thing in this or that way won't suit some (many) developers. I suppose these are reasons why Microsoft haven't created a similar project for the past 15-20 years.


Andrei Smolin
Add-in Express Team Leader
Posted 11 Sep, 2014 04:49:29 Top