Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to obtain current selection using C++

In a prior thread, I learned that the parameters passed to Excel via C++ are
essentially the same as the EXCEL macro language.

Wit this I've made great progress, but have run into a different problem. I
have the following sequence of steps, all being calls to Excel4 :

(xlcFormulaGoto,<xlResult,1, <celladdress);
(xlcSelectSpecial,<xlResult,2,<currentregion,<al ltypes);
(xlcSelection,<xlCurrRange,0);

where the < bracketed items are XLOPERs. (current region has value 5 and
alltypes value 23, as documented in the SelectSpecial macro function)

I confirmed that the first two steps work by returning to EXCEL after them
instead of continuing.

But the call to xlcSelection to obtain a reference to the region selected by
the SelectSpecial command is returning nonsense. The XLM docs indicate that
SELECTION() (on a macro sheet) normally dereferences, so to get the actual
reference you can use REFTEXT(). I can get everything to work using a macro
sheet, but cannot figure out how to do it in C++ code.

The content of the <xlCurrRange XLOPER is of type xltypeRef, but the
reference itself is garbage.

Any suggestions would be greatly appreciated.
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
Add a row to the current Selection pokdbz Excel Programming 1 October 19th 07 02:45 PM
Adding current selection RICOUK Excel Programming 3 August 27th 05 10:31 PM
Obtain current RGB settings for color indexes 17 thru 27 quartz[_2_] Excel Programming 7 April 18th 05 10:45 PM
how can one obtain the current selected cell value Susan Hayes Excel Programming 3 December 14th 04 10:31 AM
Update on Current Selection Randal W. Hozeski Excel Programming 0 December 29th 03 04:37 PM


All times are GMT +1. The time now is 08:23 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"