Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Richard Jonas
 
Posts: n/a
Default CHR() function not working in Excel 2003

I've written a VBA application in Excel 2002, which works correctly.
This should work on all recent versions of Excel, so I've been testing
it on Excel 2003. This includes the lines:

Dim a as String
a = "text" + Chr(34)

On Excel 2003, I'm getting the error "Compile error: Can't find
project or library", and the Chr function is highlighted.

If it's helpful, I've tried commenting this line out and I also get
the same error elsewhere when I use the Space() function. The rest of
the code runs successfully.

I've seen elsewhere that I should look in the "References" option
under the "Tools" menu, but the menu option appears to be greyed out
and I can't select it.

Does anyone have any ideas why this isn't working?

Thanks,

Richard Jonas
  #2   Report Post  
Dave O
 
Posts: n/a
Default

Just a guess: from an Excel tab, click Tools Add-Ins and make sure
"Analysis Toolpak- VBA" is checked. Then compile your code again.
Hope that does it for you!

  #3   Report Post  
Jim Cone
 
Posts: n/a
Default

Richard,

"General" VBA functions are not part of Excel VBA and
may not have been installed on your 2003 machine.
(Some IT departments, do not do full installs)

Try prefacing your calls with "VBA."...
a = "text" & VBA.Chr$(34)

You may have to go back thru Control Panel/Add or Remove Programs
and install all of the VBA options.

Regards,
Jim Cone
San Francisco, USA


"Richard Jonas" wrote in message om...
I've written a VBA application in Excel 2002, which works correctly.
This should work on all recent versions of Excel, so I've been testing
it on Excel 2003. This includes the lines:

Dim a as String
a = "text" + Chr(34)

On Excel 2003, I'm getting the error "Compile error: Can't find
project or library", and the Chr function is highlighted.

If it's helpful, I've tried commenting this line out and I also get
the same error elsewhere when I use the Space() function. The rest of
the code runs successfully.

I've seen elsewhere that I should look in the "References" option
under the "Tools" menu, but the menu option appears to be greyed out
and I can't select it.

Does anyone have any ideas why this isn't working?

Thanks,

Richard Jonas

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

If you're in the middle of running your code, stop it.

Then the Tools|references may be available.

Then look under that option for references that are marked MISSING.

A missing reference will cause the procedure to not compile--and might point at
any old line.

Once you find that missing reference, you'll either have to deselect it or find
what it is and correct it.



Richard Jonas wrote:

I've written a VBA application in Excel 2002, which works correctly.
This should work on all recent versions of Excel, so I've been testing
it on Excel 2003. This includes the lines:

Dim a as String
a = "text" + Chr(34)

On Excel 2003, I'm getting the error "Compile error: Can't find
project or library", and the Chr function is highlighted.

If it's helpful, I've tried commenting this line out and I also get
the same error elsewhere when I use the Space() function. The rest of
the code runs successfully.

I've seen elsewhere that I should look in the "References" option
under the "Tools" menu, but the menu option appears to be greyed out
and I can't select it.

Does anyone have any ideas why this isn't working?

Thanks,

Richard Jonas


--

Dave Peterson
  #5   Report Post  
Richard Jonas
 
Posts: n/a
Default

Dave Peterson wrote in message ...
If you're in the middle of running your code, stop it.

Then the Tools|references may be available.

Then look under that option for references that are marked MISSING.

A missing reference will cause the procedure to not compile--and might point at
any old line.

Once you find that missing reference, you'll either have to deselect it or find
what it is and correct it.



Richard Jonas wrote:

I've written a VBA application in Excel 2002, which works correctly.
This should work on all recent versions of Excel, so I've been testing
it on Excel 2003. This includes the lines:

Dim a as String
a = "text" + Chr(34)

On Excel 2003, I'm getting the error "Compile error: Can't find
project or library", and the Chr function is highlighted.

If it's helpful, I've tried commenting this line out and I also get
the same error elsewhere when I use the Space() function. The rest of
the code runs successfully.

I've seen elsewhere that I should look in the "References" option
under the "Tools" menu, but the menu option appears to be greyed out
and I can't select it.

Does anyone have any ideas why this isn't working?

Thanks,

Richard Jonas



Thanks Dave,

I think I must not have stopped the program running when I looked
before, and when I tried today, Tools / References was available. I
found that a calendar control was labelled as missing.

My spreadsheet doesn't use a calendar control, but when I unchecked it
the Chr functions appear to work.

Kind Regards
Richard
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
quattro converter for Excel 2003 cntaylor Excel Discussion (Misc queries) 4 April 30th 07 07:08 PM
how can I get odbc plugin for Excel 2003 ? Herve Brelay Excel Discussion (Misc queries) 1 January 30th 05 12:26 AM
how to increase maximum number of columns in excel 2003 [email protected] Excel Discussion (Misc queries) 1 January 16th 05 08:13 PM
Saving Customized Toolbars in Excel 2003 MIKE MEDLIN Excel Discussion (Misc queries) 5 January 13th 05 02:03 AM
Saving a Excel 97 file into Excel 2003 file Wil Excel Discussion (Misc queries) 1 December 13th 04 11:51 PM


All times are GMT +1. The time now is 07:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"