ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA format function Win2000 and WinXP (https://www.excelbanter.com/excel-programming/345163-vba-format-function-win2000-winxp.html)

Tord

VBA format function Win2000 and WinXP
 
I am using the "Format function" to format the apperance of the caption of a
label in a dialog box. The "Format function" is working ok on my Win2000
computer. But when I switch copmputer to my WinXp computer, the "Format
function" is not working. It seems like the "Format function" will not work
when the worksheet is created on a Win2000 computer and then later is opend
on a computer using WinXP.

Plate.lbl49.Caption = Format(Worksheets("DimAlu").Cells(44, 2).Value, "###
### ###")

This line of code wil format the caption in label (lbl49) on the dialogbox
(Plate) with space between every third digit. It works on Win200 computers,
but not on a WinXP computer.

Is there anybody who know why this is happening and what is the solution to
this problem?

Tord

Tom Ogilvy

VBA format function Win2000 and WinXP
 
on the WinXP computer, after the error, go into the VBE to tools=References
and see if you have a reference marked MISSING.

If so, fix this reference as it is the cause of your problem - probably
totally unrelated to Format, but that is where the error manifests.

the lazy workaround would be vba.Format instead of just format.

--
Regards,
Tom Ogilvy


"Tord" wrote in message
...
I am using the "Format function" to format the apperance of the caption of

a
label in a dialog box. The "Format function" is working ok on my Win2000
computer. But when I switch copmputer to my WinXp computer, the "Format
function" is not working. It seems like the "Format function" will not

work
when the worksheet is created on a Win2000 computer and then later is

opend
on a computer using WinXP.

Plate.lbl49.Caption = Format(Worksheets("DimAlu").Cells(44, 2).Value, "###
### ###")

This line of code wil format the caption in label (lbl49) on the dialogbox
(Plate) with space between every third digit. It works on Win200

computers,
but not on a WinXP computer.

Is there anybody who know why this is happening and what is the solution

to
this problem?

Tord





All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com