ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   FORMAT statement in 2003 Excel Macro (https://www.excelbanter.com/excel-discussion-misc-queries/231083-format-statement-2003-excel-macro.html)

RidgeView

FORMAT statement in 2003 Excel Macro
 
I have several worksheets developed in Excel 2007 and have ported them to
computers with Excel 2003. In some cases the following statement works and
in others it does not. An example of the format statement is as follows:
SMth = Format(SecMth, "mmmm")
The macro will not compile because it gets hung up on the "Format" statement
stating that it cannot compile because either the Object or Library is not
found.
Like I stated, this statement does work in other worksheets.
HOW CAN I GET THIS TO WORK?

Sheeloo

FORMAT statement in 2003 Excel Macro
 
In VB Editor
Check Tools-References
It might be pointing to the Excel 2007 library (Excel12)
Change it to Excel11

"RidgeView" wrote:

I have several worksheets developed in Excel 2007 and have ported them to
computers with Excel 2003. In some cases the following statement works and
in others it does not. An example of the format statement is as follows:
SMth = Format(SecMth, "mmmm")
The macro will not compile because it gets hung up on the "Format" statement
stating that it cannot compile because either the Object or Library is not
found.
Like I stated, this statement does work in other worksheets.
HOW CAN I GET THIS TO WORK?


RidgeView

FORMAT statement in 2003 Excel Macro
 
I finally found the following solution. In the VB Editor, the problem was
caused by a check mark in TOOLS/REFERENCE/"Missing.....". Once removed all
worked OK.
Thanks for your response.

"Sheeloo" wrote:

In VB Editor
Check Tools-References
It might be pointing to the Excel 2007 library (Excel12)
Change it to Excel11

"RidgeView" wrote:

I have several worksheets developed in Excel 2007 and have ported them to
computers with Excel 2003. In some cases the following statement works and
in others it does not. An example of the format statement is as follows:
SMth = Format(SecMth, "mmmm")
The macro will not compile because it gets hung up on the "Format" statement
stating that it cannot compile because either the Object or Library is not
found.
Like I stated, this statement does work in other worksheets.
HOW CAN I GET THIS TO WORK?



All times are GMT +1. The time now is 04:16 AM.

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