Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Problems running macros due to migration from Windows XP Excel 2007 to Windows 7 Enterprise Excel 2010

Posted on 2013-11-12
2
174 Views
Last Modified: 2013-11-12
Hello,

I am trying to run the following code but get a compile error stating that a project or library cannot be found.

If Left(Sheets("OIS_FIX_CAS_ASIA").Range("P8").Value, 9) <> "UserCurve" Then
        MsgBox "Please check OIS_FIX_CAS_ASIA curve", vbOKOnly + vbCritical, "CURVE CHECK!"
        End
End If

The highlighted problem appears to be "Left".

Thanks.
0
Comment
Question by:f19l
2 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 300 total points
ID: 39641500
This behavior has been known in cases where there are missing references. Use the VBE menu Tools > References and deselect any references prefixed by "MISSING"
0
 
LVL 18

Assisted Solution

by:Steven Harris
Steven Harris earned 200 total points
ID: 39641510
Your syntax is correct.

I am trying to run the following code but get a compile error stating that a project or library cannot be found.

There is your issue.  What items do you show checked under Tools > References?  Do any of the objects say MISSING?

You should have standard items similar to:

-Visual Basic For Applications
-Microsoft Excel Object Library
-OLE Automation

You can also try the following:

If VBA.Left(Sheets("OIS_FIX_CAS_ASIA").Range("P8").Value, 9) <> "UserCurve" Then
        MsgBox "Please check OIS_FIX_CAS_ASIA curve", vbOKOnly + vbCritical, "CURVE CHECK!"
        End
End If

Open in new window

0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question