ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compile Error (https://www.excelbanter.com/excel-programming/311674-compile-error.html)

Francis Ang[_3_]

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.

ExcelMonkey[_166_]

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


No Name

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.
.


Tom Ogilvy

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.




Myrna Larson

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.



Francis Ang[_3_]

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



Francis Ang[_3_]

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.
.



Francis Ang[_3_]

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.




Francis Ang[_3_]

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.






All times are GMT +1. The time now is 10:56 PM.

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