Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Wierd problem in VBA code re Mid function

  Asked By: Hamish    Date: Jan 26    Category: MS Office    Views: 1975
  

I have changed from one machine to another recently and have started
getting a "Compile Error"
"Can't find project or library "
unexplainedly when I run a routine (that worked on the old machine).
I am using Office Professional 2003 on Windows XP.

The compile error occurs on the VBA statement:
currow = Int(Mid(ActiveCell.Address, locrowt1 + 1))

The problem appears to be that the Mid function is not being
recognized as a valid function. In this spreadsheet, whenever I
type "MID(" no autocomplete help shows as it does, for example if I
type "Instr(". This suggests that something is corrupted the
recognition of the built-in function "Mid".

If I create a new spreadsheet, and place the same statement in a
routine, then all is fine.

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Alexander Fields     Answered On: Jan 26


Not sure of my ground here; on my xp pro with xl2003 under
Tools|References in the VBE I have:

Visual Basic For Applications
Microsoft Excel 11.0 Object Library
OLE Automation
Microsoft Office 11.0 Object Library

all checked, any of those missing?

 
Answer #2    Answered By: Vivian Ruiz     Answered On: Jan 26

Is this a Duh! or what?

I use this a lot. I though so and I just verified. MID is a $tring
function... It is MID$( then you should get the auto complete.

Excel 2002 VB 6.3 on Win XP

 
Didn't find what you were looking for? Find more on Wierd problem in VBA code re Mid function Or get search suggestion and latest updates.




Tagged: