Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default COM automation in CPP question about array

Hi,

I want to do the following with automation :

* Get a cell that is containing a formula (let's call it A1).
* Resize the range to be 5 by 5
* Enter a new formula in A1 that will be an array function and output in the
new range.

I did the following :

Range range = m_pExcelApplication.GetActiveCell();
if(range != NULL)
{
Range resizedRange =
range.GetResize(_variant_t((long)5),_variant_t((lo ng)5));

lColumn = formulaRange.GetColumn();
lRow = formulaRange.GetRow();
tmp.Format("column : %u, row : %u", lColumn, lRow);
OutputDebugString(tmp); //give me "column : 5, row : 5"
resizedRange.Select();
formulaRange.SetFormulaArray(_variant_t("=myNewFor mula"));
}

But it doesn't work.
I always get the "Unable to set the FormulaArray property of the Range
class" error.

Can anybody help me?

Thanks

Nic


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
General Macro/Automation Question Dave Excel Discussion (Misc queries) 1 June 28th 07 02:00 PM
Automation 2-Part Question... Bob Barnes Excel Discussion (Misc queries) 0 March 26th 06 11:54 PM
Sendkeys/general automation question Mark Stephens[_3_] Excel Programming 2 August 1st 05 01:42 AM
Excel automation question [email protected] Excel Programming 2 July 14th 05 12:22 AM
Automation Question Mark Excel Programming 3 March 25th 05 09:29 PM


All times are GMT +1. The time now is 11:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"