Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Compile Error

I developed the following macros using Excel 2002 running on Windows XP
Professional -

If dir("C:\File_Name.txt")< "" then
my_data = mid(input,1,4)
Endif

When I execute the macro using Excel 1997 SR2 running on Windows 98 an error
message pops up - 'Can't find project or library'

This greek to me. Can someone tell me I have done wrong and how to rectify
this situation.

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Compile Error


Not sure about this, but there might be the odd chance that the Mi
function was not being used in Excel/VBA 97. Try substituting you
"Mid()" in the code with "WorksheetFunction.Mid()". This assumes tha
Excel had a Mid function in 97 which you can pull into your code. Tr
it an see what happens

--
ExcelMonke
-----------------------------------------------------------------------
ExcelMonkey's Profile: http://www.excelforum.com/member.php...nfo&userid=522
View this thread: http://www.excelforum.com/showthread.php?threadid=26414

  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Compile Error

hi,
not sure but it may be a library thing.
open VB editor (Alt+F11)
goto toolsreferences
there will be all your librarys. i don't know which one
you are missing but most probably it's one of them.
note: it is not wise to write code in a higher version
application and expect it to run on a lower version.
most app developers try to make the apps backwards
compatible but few can make them forward compatable.
many times there are no problems with this but sometimes
there are.

-----Original Message-----
I developed the following macros using Excel 2002 running

on Windows XP
Professional -

If dir("C:\File_Name.txt")< "" then
my_data = mid(input,1,4)
Endif

When I execute the macro using Excel 1997 SR2 running on

Windows 98 an error
message pops up - 'Can't find project or library'

This greek to me. Can someone tell me I have done wrong

and how to rectify
this situation.

Thank you.
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Compile Error

In the VBE go to tools=References and in the references at the top, there
should be at least one shown as MISSING. Although this is probably not
related to the MID function, that is just where Excel decides to tell you
about it. In any event, if you need this reference, then you need to fix
it by finding it on that machine using the browse button. If you don't need
it, then you should go back to your machine and the source file and remove
it there. Then save the file and redistribute.

As others have advised, you should do your development on the oldest version
of Excel that will need to use the code.

--
Regards,
Tom Ogilvy

"Francis Ang" wrote in message
...
I developed the following macros using Excel 2002 running on Windows XP
Professional -

If dir("C:\File_Name.txt")< "" then
my_data = mid(input,1,4)
Endif

When I execute the macro using Excel 1997 SR2 running on Windows 98 an

error
message pops up - 'Can't find project or library'

This greek to me. Can someone tell me I have done wrong and how to rectify
this situation.

Thank you.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Compile Error

See Tom's response re missing references.

But I note you seem to be using Input as though its the name of a string
variable. Input is a reserved word, the name of a function used in reading
text files. You should pick a different name for your variable.

On Tue, 28 Sep 2004 02:33:03 -0700, "Francis Ang"
wrote:

I developed the following macros using Excel 2002 running on Windows XP
Professional -

If dir("C:\File_Name.txt")< "" then
my_data = mid(input,1,4)
Endif

When I execute the macro using Excel 1997 SR2 running on Windows 98 an error
message pops up - 'Can't find project or library'

This greek to me. Can someone tell me I have done wrong and how to rectify
this situation.

Thank you.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Compile Error

You are right, when the error message pops up, the function "Mid" is
highlighted. I actually forget to mention this earlier. Thank you very much
for the advice.

"ExcelMonkey" wrote:


Not sure about this, but there might be the odd chance that the Mid
function was not being used in Excel/VBA 97. Try substituting your
"Mid()" in the code with "WorksheetFunction.Mid()". This assumes that
Excel had a Mid function in 97 which you can pull into your code. Try
it an see what happens.


--
ExcelMonkey
------------------------------------------------------------------------
ExcelMonkey's Profile: http://www.excelforum.com/member.php...fo&userid=5221
View this thread: http://www.excelforum.com/showthread...hreadid=264140


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Compile Error

Thank you for the advice. Well now write macros using lower version of Excel.

" wrote:

hi,
not sure but it may be a library thing.
open VB editor (Alt+F11)
goto toolsreferences
there will be all your librarys. i don't know which one
you are missing but most probably it's one of them.
note: it is not wise to write code in a higher version
application and expect it to run on a lower version.
most app developers try to make the apps backwards
compatible but few can make them forward compatable.
many times there are no problems with this but sometimes
there are.

-----Original Message-----
I developed the following macros using Excel 2002 running

on Windows XP
Professional -

If dir("C:\File_Name.txt")< "" then
my_data = mid(input,1,4)
Endif

When I execute the macro using Excel 1997 SR2 running on

Windows 98 an error
message pops up - 'Can't find project or library'

This greek to me. Can someone tell me I have done wrong

and how to rectify
this situation.

Thank you.
.


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Compile Error

Thank you for the advice. Appreciate the help very much.

See Tom's response re missing references.

But I note you seem to be using Input as though its the name of a string
variable. Input is a reserved word, the name of a function used in reading
text files. You should pick a different name for your variable.

On Tue, 28 Sep 2004 02:33:03 -0700, "Francis Ang"
wrote:

I developed the following macros using Excel 2002 running on Windows XP
Professional -

If dir("C:\File_Name.txt")< "" then
my_data = mid(input,1,4)
Endif

When I execute the macro using Excel 1997 SR2 running on Windows 98 an error
message pops up - 'Can't find project or library'

This greek to me. Can someone tell me I have done wrong and how to rectify
this situation.

Thank you.



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Compile Error

Thank you very much for the advice, Tom. Will now write macros using lower
version of Excel.


"Tom Ogilvy" wrote:

In the VBE go to tools=References and in the references at the top, there
should be at least one shown as MISSING. Although this is probably not
related to the MID function, that is just where Excel decides to tell you
about it. In any event, if you need this reference, then you need to fix
it by finding it on that machine using the browse button. If you don't need
it, then you should go back to your machine and the source file and remove
it there. Then save the file and redistribute.

As others have advised, you should do your development on the oldest version
of Excel that will need to use the code.

--
Regards,
Tom Ogilvy

"Francis Ang" wrote in message
...
I developed the following macros using Excel 2002 running on Windows XP
Professional -

If dir("C:\File_Name.txt")< "" then
my_data = mid(input,1,4)
Endif

When I execute the macro using Excel 1997 SR2 running on Windows 98 an

error
message pops up - 'Can't find project or library'

This greek to me. Can someone tell me I have done wrong and how to rectify
this situation.

Thank you.




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
Solver - error - Compile Error Nina Excel Discussion (Misc queries) 0 August 19th 08 09:41 PM
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Compile error in hidden module error Melissa Zebrowski Excel Programming 3 February 20th 04 01:29 PM


All times are GMT +1. The time now is 12:12 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"