Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Altering UI Programatically

I use Excel 97 on Windows NT4. I have a monthly mileage spreadsheet to
produce, where users enter mileage day by day. At the end of the month
they submit the sheet by pressing a button. The button

a. changes the font colour of the data they have input to signify that
the data has been processed

b. makes the sheet read-only by applying locking to all cells and then
protecting them

My button code is

Sheet1.Range("A1:F8").Font.ColorIndex = 3
.... ' lock cells
.... ' protect sheet

I get the error message "Could not set the ColorIndex property of the
Range class". As the cells are not locked and the sheet is not
protected, I am at a loss to explain why the Range settings appear to
be read-only. If I do

Sheet1.Range("A1:F8").Formula = "= rand() * 10000"

I get random numbers with no problems. In other words it appears that
I can set "background" properties OK but not "foreground" (ie UI)
properties. I tried altering FormatConditions for the cells and got a
similar error message. Can anyone help with this? Thanks a lot in
advance...


----------------------------------------------------
Do NOT reply to the email address in the headers. It
is an address used solely for trapping spam and its
contents are never checked. If you want to reply to
this message, please post to the newsgroup.
----------------------------------------------------
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Altering UI Programatically

Assume this is a commandbutton from the Control toolbox toolbar. Change the
TakeFocusOnclick property of the commandbutton to False.

--
Regards,
Tom Ogilvy


Alan Greenwood wrote in message
...
I use Excel 97 on Windows NT4. I have a monthly mileage spreadsheet to
produce, where users enter mileage day by day. At the end of the month
they submit the sheet by pressing a button. The button

a. changes the font colour of the data they have input to signify that
the data has been processed

b. makes the sheet read-only by applying locking to all cells and then
protecting them

My button code is

Sheet1.Range("A1:F8").Font.ColorIndex = 3
... ' lock cells
... ' protect sheet

I get the error message "Could not set the ColorIndex property of the
Range class". As the cells are not locked and the sheet is not
protected, I am at a loss to explain why the Range settings appear to
be read-only. If I do

Sheet1.Range("A1:F8").Formula = "= rand() * 10000"

I get random numbers with no problems. In other words it appears that
I can set "background" properties OK but not "foreground" (ie UI)
properties. I tried altering FormatConditions for the cells and got a
similar error message. Can anyone help with this? Thanks a lot in
advance...


----------------------------------------------------
Do NOT reply to the email address in the headers. It
is an address used solely for trapping spam and its
contents are never checked. If you want to reply to
this message, please post to the newsgroup.
----------------------------------------------------



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Altering UI Programatically

Great stuff, Tom - thanks a lot.

On Sat, 1 Nov 2003 08:31:34 -0500, "Tom Ogilvy"
wrote:

Assume this is a commandbutton from the Control toolbox toolbar. Change the
TakeFocusOnclick property of the commandbutton to False.


----------------------------------------------------
Do NOT reply to the email address in the headers. It
is an address used solely for trapping spam and its
contents are never checked. If you want to reply to
this message, please post to the newsgroup.
----------------------------------------------------
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
Help with altering a formula cherman Excel Worksheet Functions 3 February 25th 10 09:18 PM
altering text to other column Terry Berry Excel Worksheet Functions 4 November 22nd 08 03:13 AM
copy without altering the value freebee Excel Discussion (Misc queries) 4 October 31st 08 06:09 AM
Altering the X-axis Maguire Charts and Charting in Excel 2 May 14th 06 07:45 PM
Formula keeps altering by itself! Julie P. Excel Worksheet Functions 3 February 2nd 05 10:20 AM


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

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"