+ Reply to Thread
Results 1 to 13 of 13

Chr() now doesn't work !

Hybrid View

  1. #1
    Registered User
    Join Date
    11-18-2011
    Location
    Dorset
    MS-Off Ver
    Excel 365
    Posts
    37

    Chr() now doesn't work !

    In my "add-on library" - that I have been using / developing over the past 30 years - I have quite a few routines that use the "Chr()" function, e.g. Chr(34) provides inverted commas ".

    "All of a sudden" - about a week ago - this generates an error. This means that -
    .
    I HAVE NOT BEEN ABLE TO USE EXCEL FOR A WEEK !
    .
    Presumably this is yet another Microsoft downgrade :-(

    How do I overcome this ?

    Pretty please ?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,492

    Re: Chr() now doesn't work !

    Range("A1")=Chr(34)
    This works fine for me in Excel 365 Office Insider Beta Channel so I'm guessing it's not a new "feature".
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-18-2011
    Location
    Dorset
    MS-Off Ver
    Excel 365
    Posts
    37

    Re: Chr() now doesn't work !

    Quote Originally Posted by TMS View Post
    Range("A1")=Chr(34)
    This works fine for me in Excel 365 Office Insider Beta Channel so I'm guessing it's not a new "feature".
    Thanks for your response;
    I have
    Microsoft Visual Basic for Applications 7.1
    VBA: Retail 7.1.1121 Forms3: 16.0.14931.20008
    "Automatic update" is ON.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,492

    Re: Chr() now doesn't work !

    What have you tried to fix it? I'd be inclined to save and close all instances of Excel and/or reboot the machine. Failing that,maybe repair Excel?

  5. #5
    Registered User
    Join Date
    11-18-2011
    Location
    Dorset
    MS-Off Ver
    Excel 365
    Posts
    37

    Re: Chr() now doesn't work !

    Quote Originally Posted by TMS View Post
    What have you tried to fix it? I'd be inclined to save and close all instances of Excel and/or reboot the machine. Failing that,maybe repair Excel?
    Thank you for those two suggestions.

    1.
    I re-boot every morning, so that's not a "solver"

    2.
    . . . . so last night I did a full "repair" of 365, but that made no difference.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Chr() now doesn't work !

    Perhaps if you upload a workbook that contains the add on routine in question then we may be able to assist further.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  7. #7
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,475

    Re: Chr() now doesn't work !

    Try changing one of the Chr(..) to VBA.Chr(..) and see if that line of code then works. If it does, that usually means you have a variable, function or subroutine within the same scope as the non-working code with the name Chr.

  8. #8
    Registered User
    Join Date
    11-18-2011
    Location
    Dorset
    MS-Off Ver
    Excel 365
    Posts
    37

    Re: Chr() now doesn't work !

    Quote Originally Posted by Rick Rothstein View Post
    Try changing one of the Chr(..) to VBA.Chr(..) and see if that line of code then works.
    VOILA ! That does the job ! Thank you !

    If it does, that usually means you have a variable, function or subroutine within the same scope as the non-working code with the name Chr.
    The error message is:-
    Compile error:
    Can't find project or library


    BUT . . .
    I pressed F5, & off it went, so I came back here to reply - but I went back to check - and :-(
    It had stopped again with that same error message - but THIS time, it baulked at Left(.
    Prefixing your "VBA." in front solved THAT - but THEN it stopped at Right(

    Something VERY fishy here . . .
    Last edited by RobinClay; 07-04-2022 at 05:53 AM. Reason: Typo

  9. #9
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,542

    Re: Chr() now doesn't work !

    It looks as if a reference to any of the libraries has been lost.

    Artik

  10. #10
    Registered User
    Join Date
    11-18-2011
    Location
    Dorset
    MS-Off Ver
    Excel 365
    Posts
    37

    Re: Chr() now doesn't work !

    Thank you, Artik !
    Alas ! I didn't understand, but see below.
    Last edited by RobinClay; 07-04-2022 at 04:06 PM.

  11. #11
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,008

    Re: Chr() now doesn't work !

    You have a missing reference. Check Tools - References - one of them will be prefixed with MISSING:
    Everyone who confuses correlation and causation ends up dead.

  12. #12
    Registered User
    Join Date
    11-18-2011
    Location
    Dorset
    MS-Off Ver
    Excel 365
    Posts
    37

    Re: Chr() now doesn't work !

    Quote Originally Posted by rorya View Post
    You have a missing reference. Check Tools - References - one of them will be prefixed with MISSING:
    Thank you for that.
    I checked, and YES !

    MISSING: NavNLU.xla
    Location: K:\Excel\LELTACS\NavNLU.xla

    So thither I went, and did a search in that folder and . . .

    NavNLU.xla
    K:\Excel\LELTACS
    Date modified: 23/06/2022 08:40
    Size: 377 KB

    So it IS there, but I guess I was correct; that Microsoft has downgraded / interferred, for that is the date Excel stopped working.


    Now - Pretty please ? - how do I re-connect it ?
    Well . . . I started to "fiddle around", and in Excel I found > Developer > Add-ins > Excel Add-ins - and THERE was the Suspect. So I clicked on it, and . . .

    Microsoft Excel cannot access the file 'K:\Excel\LELTACS\NavNLU.xla'. There are several possible reasons:
    • The file name or path does not exist.
    • The file is being used by another program.
    • The workbook you are trying to save has the same name as a currently open workbook.

    Well, none of those apply, so I then went to that folder, found the file and clicked on it -

    Microsoft Excel

    The last time you opened 'NavNLU.xIa', it caused a serious error. Do you still want to open it?

    So I clicked on "Yes", and it seems to have re-instated with (so far) no ill effects !

    So all MAY be well. I shall see tomorrow !
    Last edited by RobinClay; 07-04-2022 at 07:32 PM.

  13. #13
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,008

    Re: Chr() now doesn't work !

    What happens if you browse to it from the references dialog?

    Also, is it required for the code in question?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] IF then with like doesn't work
    By wingfield65 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-05-2021, 02:07 AM
  2. If statement - unable to work out why it doesn't work
    By vba_newbie83 in forum Excel General
    Replies: 3
    Last Post: 11-25-2019, 09:26 AM
  3. Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work.
    By MayDay1988 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2017, 06:14 PM
  4. [SOLVED] F4 doesn't work only in excel, how to make it work again?
    By Dave H in forum Excel General
    Replies: 1
    Last Post: 02-26-2014, 11:22 AM
  5. [SOLVED] Macro work in personal workbook, doesn't work in other workbooks
    By Centexcel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-30-2013, 11:47 AM
  6. [SOLVED] Macro Doesn't Work Through Button, Does Work Through Developer ->Macros Option
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-27-2013, 11:55 AM
  7. F 5 doesn't work right.
    By mrl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2010, 11:04 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1