Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Programmatic font face problem

Howdy
Hope you had a great Christmas (for those of you that celebrate it)!

Back at work now! Got a problem.

I programmatically create 4 columns by 30 rows of (control) form elements,
and the form elements are either a checkbox or are a label with the ASCII
character returned by VBA Chr(254) and set to Wingdings font (which SHOULD
show a "non-clickable" checkbox).

(Whether it is a label or a checkbox form element depends on a True or False
value in a corresponding 4 x 30 matrix on another worksheet.)

The problem is that only some of my Labels show the "unclickable" checkbox,
whilst the other labels show the Chr(254) NOT formatted in Wingdings font
(in what must be the default font of Arial), even though in the Properties
for the label it does actually say that the label has it's Font set to
Wingdings...!!! There does not appear to be any pattern to which of the
labels show a checkbox and which show the ASCII character without the
Wingdings font even though it says it is Wingdings...???

Seems like a bug. It happens on both Excel 97 and 2002.

Any idea what the problem is and how to fix it?

Thanks a lot
Matt


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Programmatic font face problem

Try DoEvents after setting the font name, or after setting the label
caption which ever is later.

Sharad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Programmatic font face problem

Hi Matt

My unfortunate experiences a If you repeatedly add and delete objects in
a workbook, they don't delete properly and hidden junk piles up somewhere
inaccessible. The workbook becomes unstable after a while until it becomes
corrupted beyond hope.

Otherwise, lots of controls in a worksheet is very demanding on graphical
resources and things like this can happen in the "display" part of Excel.
Make sure you don't have multiple windows open and that zoom is nothing but
100%.

Apologies for the unscientific reply.
HTH. Best wishes Harald

"Matt Jensen" skrev i melding
...
Howdy
Hope you had a great Christmas (for those of you that celebrate it)!

Back at work now! Got a problem.

I programmatically create 4 columns by 30 rows of (control) form elements,
and the form elements are either a checkbox or are a label with the ASCII
character returned by VBA Chr(254) and set to Wingdings font (which SHOULD
show a "non-clickable" checkbox).

(Whether it is a label or a checkbox form element depends on a True or

False
value in a corresponding 4 x 30 matrix on another worksheet.)

The problem is that only some of my Labels show the "unclickable"

checkbox,
whilst the other labels show the Chr(254) NOT formatted in Wingdings font
(in what must be the default font of Arial), even though in the Properties
for the label it does actually say that the label has it's Font set to
Wingdings...!!! There does not appear to be any pattern to which of the
labels show a checkbox and which show the ASCII character without the
Wingdings font even though it says it is Wingdings...???

Seems like a bug. It happens on both Excel 97 and 2002.

Any idea what the problem is and how to fix it?

Thanks a lot
Matt




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Programmatic font face problem

G'day Sharad and Harald

I've done some testing since including using implications of your answers,
and after noticing that whilst there was no pattern of which ones were
formatted correctly vs. incorrectly, I noticed that it always happened in
the same places.

I deleted every VBA reference to Wingdings and discovered that some remnants
of earlier developing had randomly left font face settings on the *cells*
below and this was driving the label above's font face!!

Now I've found that the pattern for which was formatted correctly and which
wasn't is directly related to the Font setting for the cell below the
label!!

I've fixed that and now it seems to be all good! Hooray!! Seems strange
though...

One problem that remains though (and is somewhat different from this problem
but still relevant to it) is that, even though at the start of the proc I
have Application.Screenupdating = False & (pseudo code) cursor=hourglass and
set it back to true and xldefault at the end of the proc respectively,
setting the *caption* of the label occurs after (it appears) that the proc
has finished (cursor goes back to default AND is visible onscreen), which is
not good at all and what I would have thought screenupdating prevented from
happening....? I thought DoEvents may have helped with this, but it doesn't!

Any way of stopping this?
Thanks again a lot
Cheers
Matt


"Harald Staff" wrote in message
...
Hi Matt

My unfortunate experiences a If you repeatedly add and delete objects

in
a workbook, they don't delete properly and hidden junk piles up somewhere
inaccessible. The workbook becomes unstable after a while until it becomes
corrupted beyond hope.

Otherwise, lots of controls in a worksheet is very demanding on graphical
resources and things like this can happen in the "display" part of Excel.
Make sure you don't have multiple windows open and that zoom is nothing

but
100%.

Apologies for the unscientific reply.
HTH. Best wishes Harald

"Matt Jensen" skrev i melding
...
Howdy
Hope you had a great Christmas (for those of you that celebrate it)!

Back at work now! Got a problem.

I programmatically create 4 columns by 30 rows of (control) form

elements,
and the form elements are either a checkbox or are a label with the

ASCII
character returned by VBA Chr(254) and set to Wingdings font (which

SHOULD
show a "non-clickable" checkbox).

(Whether it is a label or a checkbox form element depends on a True or

False
value in a corresponding 4 x 30 matrix on another worksheet.)

The problem is that only some of my Labels show the "unclickable"

checkbox,
whilst the other labels show the Chr(254) NOT formatted in Wingdings

font
(in what must be the default font of Arial), even though in the

Properties
for the label it does actually say that the label has it's Font set to
Wingdings...!!! There does not appear to be any pattern to which of the
labels show a checkbox and which show the ASCII character without the
Wingdings font even though it says it is Wingdings...???

Seems like a bug. It happens on both Excel 97 and 2002.

Any idea what the problem is and how to fix it?

Thanks a lot
Matt






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Programmatic font face problem

"Matt Jensen" skrev i melding
...
I've fixed that and now it seems to be all good! Hooray!! Seems strange
though...


Well spotted, well done.

One problem that remains though (and is somewhat different from this

problem
but still relevant to it) is that, even though at the start of the proc I
have Application.Screenupdating = False & (pseudo code) cursor=hourglass

and
set it back to true and xldefault at the end of the proc respectively,
setting the *caption* of the label occurs after (it appears) that the proc
has finished (cursor goes back to default AND is visible onscreen), which

is
not good at all and what I would have thought screenupdating prevented

from
happening....? I thought DoEvents may have helped with this, but it

doesn't!

Should work. Make sure the order of operations is something like

Sub tester()
Application.Cursor = xlWait
Application.ScreenUpdating = False
'formatting here
DoEvents
Application.ScreenUpdating = True
Application.Cursor = xlDefault
End Sub

HTH. Best wishes Harald




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Programmatic font face problem

No luck Harald

I now have a more important issue though regarding same workbook and a
similar problem but in Excel 97.

Excel 97 won't apply the formatting to the labels either way it seems. The
label show the font of Wingdings, but it won't display the caption that I
programmatically added in the Wingdings font. The properties dialogue shows
the caption as what it should be (chr 254) and the font face what it should
be (Wingdings) however the label is actually showing the caption as an Arial
chr(254) i.e. as if I added the caption as an Arial chr(254) even though the
font for the label is set to Wingdings. It's like I need to be able to
specify that the caption I'm adding should be in the Wingdings font.

I tried setting the label's locked value to false before setting the label
and caption but to no avail
Any suggestions?
Thanks
Matt


"Harald Staff" wrote in message
...
"Matt Jensen" skrev i melding
...
I've fixed that and now it seems to be all good! Hooray!! Seems strange
though...


Well spotted, well done.

One problem that remains though (and is somewhat different from this

problem
but still relevant to it) is that, even though at the start of the proc

I
have Application.Screenupdating = False & (pseudo code) cursor=hourglass

and
set it back to true and xldefault at the end of the proc respectively,
setting the *caption* of the label occurs after (it appears) that the

proc
has finished (cursor goes back to default AND is visible onscreen),

which
is
not good at all and what I would have thought screenupdating prevented

from
happening....? I thought DoEvents may have helped with this, but it

doesn't!

Should work. Make sure the order of operations is something like

Sub tester()
Application.Cursor = xlWait
Application.ScreenUpdating = False
'formatting here
DoEvents
Application.ScreenUpdating = True
Application.Cursor = xlDefault
End Sub

HTH. Best wishes Harald




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Harald?

You still around mate?
Thanks
Matt

"Matt Jensen" wrote in message
...
No luck Harald

I now have a more important issue though regarding same workbook and a
similar problem but in Excel 97.

Excel 97 won't apply the formatting to the labels either way it seems. The
label show the font of Wingdings, but it won't display the caption that I
programmatically added in the Wingdings font. The properties dialogue

shows
the caption as what it should be (chr 254) and the font face what it

should
be (Wingdings) however the label is actually showing the caption as an

Arial
chr(254) i.e. as if I added the caption as an Arial chr(254) even though

the
font for the label is set to Wingdings. It's like I need to be able to
specify that the caption I'm adding should be in the Wingdings font.

I tried setting the label's locked value to false before setting the label
and caption but to no avail
Any suggestions?
Thanks
Matt


"Harald Staff" wrote in message
...
"Matt Jensen" skrev i melding
...
I've fixed that and now it seems to be all good! Hooray!! Seems

strange
though...


Well spotted, well done.

One problem that remains though (and is somewhat different from this

problem
but still relevant to it) is that, even though at the start of the

proc
I
have Application.Screenupdating = False & (pseudo code)

cursor=hourglass
and
set it back to true and xldefault at the end of the proc respectively,
setting the *caption* of the label occurs after (it appears) that the

proc
has finished (cursor goes back to default AND is visible onscreen),

which
is
not good at all and what I would have thought screenupdating prevented

from
happening....? I thought DoEvents may have helped with this, but it

doesn't!

Should work. Make sure the order of operations is something like

Sub tester()
Application.Cursor = xlWait
Application.ScreenUpdating = False
'formatting here
DoEvents
Application.ScreenUpdating = True
Application.Cursor = xlDefault
End Sub

HTH. Best wishes Harald






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
export filter - programmatic access to Peter Charts and Charting in Excel 0 October 28th 08 10:43 PM
Programmatic Hiding [email protected] Excel Discussion (Misc queries) 2 September 29th 07 01:13 PM
Problem face in Validation Command (Pop-up Error Box) Nono Excel Worksheet Functions 1 September 3rd 07 01:38 PM
J-walk face id menu - Problem Madiya Excel Programming 3 August 21st 04 11:19 AM
Excel VBA programmatic validation problem ZoomZoom Excel Programming 10 June 3rd 04 05:21 PM


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