PC Review


Reply
Thread Tools Rate Thread

Disable Range Selection Change

 
 
Chip Pearson
Guest
Posts: n/a
 
      26th Jan 2007
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" <(E-Mail Removed)> wrote in message
news:eJ$(E-Mail Removed)...
> 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 With Quote
 
 
 
 
Dr. Patrick Havel
Guest
Posts: n/a
 
      26th Jan 2007
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 With Quote
 
Dr. Patrick Havel
Guest
Posts: n/a
 
      26th Jan 2007
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" <(E-Mail Removed)> schrieb im Newsbeitrag
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:eJ$(E-Mail Removed)...
>> 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 With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      27th Jan 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:%(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:eJ$(E-Mail Removed)...
>>> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
change Selection to specific Range Damian Microsoft Excel Misc 0 1st Sep 2009 09:23 PM
Change InputBox Range Selection to Column Letter Selection intoit Microsoft Excel Programming 2 21st Jul 2009 07:58 AM
combobox selection to change cell range data ryan.fitzpatrick3@safeway.com Microsoft Excel Programming 1 20th Mar 2009 07:04 AM
disable range selection bshumsky06@yahoo.com Microsoft Excel Programming 2 7th Jun 2006 03:37 PM
Change print range default from all to selection =?Utf-8?B?Y2xlYW5lcg==?= Microsoft Word Document Management 3 31st Jul 2005 04:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:11 PM.