ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Project-Library Error (https://www.excelbanter.com/excel-programming/331581-project-library-error.html)

lee

Project-Library Error
 
Below is some code that I got off a website and modified to determine the
location and name of a file. It has been working fine for the last couple of
years. We recently transitioned to XP and Office 2003. Now I'm getting a
compile error - "Can't find project or library" and the word "Right" is
highlighted.

'Set path, filename, and tab name
On Error Resume Next
Set sh = ActiveSheet
spath = ActiveWorkbook.Path
If Right(spath, 1) < "\" Then spath = spath & "\"
Name = spath & ActiveWorkbook.Name
CodeName = sh.CodeName

I've declared sh as Worksheet, spath as string, Name as string, and Codename
as string.

Has something changed in Office 2003 or do I have an error elsewhere?

Thanks,
--
Lee Kirts

Bob Phillips[_7_]

Project-Library Error
 
If you go to the VB IDE and look in ToolsReferences you will find an item
preceded by MISSING. Uncheck that, run your code, and see if you need to
restore any libraries to the latest version.

--
HTH

Bob Phillips

"Lee" wrote in message
...
Below is some code that I got off a website and modified to determine the
location and name of a file. It has been working fine for the last couple

of
years. We recently transitioned to XP and Office 2003. Now I'm getting a
compile error - "Can't find project or library" and the word "Right" is
highlighted.

'Set path, filename, and tab name
On Error Resume Next
Set sh = ActiveSheet
spath = ActiveWorkbook.Path
If Right(spath, 1) < "\" Then spath = spath & "\"
Name = spath & ActiveWorkbook.Name
CodeName = sh.CodeName

I've declared sh as Worksheet, spath as string, Name as string, and

Codename
as string.

Has something changed in Office 2003 or do I have an error elsewhere?

Thanks,
--
Lee Kirts




lee

Project-Library Error
 
Bob,

Thank you. There was a viewer control missing. Unchecked it, recompiled,
ran it and it worked fine. Thanks again
--
Lee Kirts


"Bob Phillips" wrote:

If you go to the VB IDE and look in ToolsReferences you will find an item
preceded by MISSING. Uncheck that, run your code, and see if you need to
restore any libraries to the latest version.

--
HTH

Bob Phillips

"Lee" wrote in message
...
Below is some code that I got off a website and modified to determine the
location and name of a file. It has been working fine for the last couple

of
years. We recently transitioned to XP and Office 2003. Now I'm getting a
compile error - "Can't find project or library" and the word "Right" is
highlighted.

'Set path, filename, and tab name
On Error Resume Next
Set sh = ActiveSheet
spath = ActiveWorkbook.Path
If Right(spath, 1) < "\" Then spath = spath & "\"
Name = spath & ActiveWorkbook.Name
CodeName = sh.CodeName

I've declared sh as Worksheet, spath as string, Name as string, and

Codename
as string.

Has something changed in Office 2003 or do I have an error elsewhere?

Thanks,
--
Lee Kirts






All times are GMT +1. The time now is 03:39 PM.

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