Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
export filter - programmatic access to | Charts and Charting in Excel | |||
Programmatic Hiding | Excel Discussion (Misc queries) | |||
Problem face in Validation Command (Pop-up Error Box) | Excel Worksheet Functions | |||
J-walk face id menu - Problem | Excel Programming | |||
Excel VBA programmatic validation problem | Excel Programming |