ChrW and Format functions not working!

jkharmer

Board Regular
Joined
Jul 7, 2008
Messages
77
Hi,

I am using Microsoft 365 for Excel. I have a workbook which I have only just returned to after a few months of not using and there is something weird going on with some of my macros. I have discovered that Excel does not like the two functions CHrW and Format. If I try to run macros with these functions in, I get a Compile Error message- Can't find project or library. I cam across the ChrW error first, and just removed the code (it was simply inserting a character tick) in favour of a simple "X" - no big deal. I then discovered the same problem with the line:

NewTestSheet.Name = "FIDCAL" & Format(Counter + 1, "00")

When I run the macro, the "Format" part is highlighted as the thing causing the macro to stop running.

Any ideas on how I can fix this, as it is a major part of my workbook - help!

J
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Microsoft 365 updates constantly in the background and I am concerned that some update has run which now means these things are not working ...
 
Upvote 0
Brilliant - thanks John! Why would the old way have stopped working do you think? I have also had to do it on another line which was using the "Right" function.
 
Upvote 0

Forum statistics

Threads
1,214,790
Messages
6,121,608
Members
449,038
Latest member
apwr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top