Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Disable Range Selection Change

Patrick,

I don't know C++ well enough to give you the C++ code (I dabble in it, but
don't do commercial work with it other than a few special-purpose DLLs), but
in VBA, you would use something like

Dim WS As Worksheet
Set WS = Worksheets("Sheet3") ' << CHANGE SHEET NAME AS REQUIRED
WS.EnableSelection = xlNoSelection ' or possibly xlUnlockedCells

Be sure to set EnableSelection back to xlNoRestrictions when appropriate.

The translation to C++ should be pretty simple.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)


"Dr. Patrick Havel" wrote in message
...
Hi *,

in my C++ program I write programatically (by COM interface) OPC measured
values into Excel cells. In order not to disturb the program write
processing I need to disable userīs range selection change during the
program access.
How can I do that?

Thanks,
Patrick



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Disable Range Selection Change

Hi *,

in my C++ program I write programatically (by COM interface) OPC measured
values into Excel cells. In order not to disturb the program write
processing I need to disable userīs range selection change during the
program access.
How can I do that?

Thanks,
Patrick


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Disable Range Selection Change

Hi Chip,

I tested both possibilities (xlNoSelection and xlUnlockedCells) but I donīt
see any effect (I can select cells by mouse click as before).

Regards,

Patrick

"Chip Pearson" schrieb im Newsbeitrag
...
Patrick,

I don't know C++ well enough to give you the C++ code (I dabble in it, but
don't do commercial work with it other than a few special-purpose DLLs),
but in VBA, you would use something like

Dim WS As Worksheet
Set WS = Worksheets("Sheet3") ' << CHANGE SHEET NAME AS REQUIRED
WS.EnableSelection = xlNoSelection ' or possibly xlUnlockedCells

Be sure to set EnableSelection back to xlNoRestrictions when appropriate.

The translation to C++ should be pretty simple.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)


"Dr. Patrick Havel" wrote in message
...
Hi *,

in my C++ program I write programatically (by COM interface) OPC measured
values into Excel cells. In order not to disturb the program write
processing I need to disable userīs range selection change during the
program access.
How can I do that?

Thanks,
Patrick





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Disable Range Selection Change

I forgot to add that you have to protect the worksheet in order for these
settings to take effect.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)

"Dr. Patrick Havel" wrote in message
...
Hi Chip,

I tested both possibilities (xlNoSelection and xlUnlockedCells) but I
donīt see any effect (I can select cells by mouse click as before).

Regards,

Patrick

"Chip Pearson" schrieb im Newsbeitrag
...
Patrick,

I don't know C++ well enough to give you the C++ code (I dabble in it,
but don't do commercial work with it other than a few special-purpose
DLLs), but in VBA, you would use something like

Dim WS As Worksheet
Set WS = Worksheets("Sheet3") ' << CHANGE SHEET NAME AS REQUIRED
WS.EnableSelection = xlNoSelection ' or possibly xlUnlockedCells

Be sure to set EnableSelection back to xlNoRestrictions when appropriate.

The translation to C++ should be pretty simple.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)


"Dr. Patrick Havel" wrote in message
...
Hi *,

in my C++ program I write programatically (by COM interface) OPC
measured values into Excel cells. In order not to disturb the program
write processing I need to disable userīs range selection change during
the program access.
How can I do that?

Thanks,
Patrick







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
change Selection to specific Range Damian Excel Discussion (Misc queries) 0 September 1st 09 09:23 PM
disable selection of pictures Abe[_4_] Excel Programming 3 July 28th 06 04:03 PM
disable range selection [email protected] Excel Programming 2 June 7th 06 03:37 PM
Disable menu selection andy Excel Discussion (Misc queries) 3 December 10th 04 10:46 PM
Macro to change list box input range based on selection made in another cell Sue[_6_] Excel Programming 3 October 7th 04 06:45 PM


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