+ Reply to Thread
Results 1 to 3 of 3

Project-Library Error

  1. #1
    Lee
    Guest

    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

  2. #2
    Bob Phillips
    Guest

    Re: Project-Library Error

    If you go to the VB IDE and look in Tools>References 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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




  3. #3
    Lee
    Guest

    Re: 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 Tools>References 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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