View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default visual basic Mid() does not work with swedish version of excel

In my experience, this is caused by a missing reference in VBE
Tools=References as stated by KeepItCool. Nick, I am only responding to
your post to emphasize KeepItCool's suggestion - this problem pops up
several times a week and invariably this is the cause.

A short stop cure is usually to qualify mid with vba.mid, but better to fix
the underlying cause.

--
Regards,
Tom Ogilvy

"NickHK" wrote in message
...
Jonas,
Usually when VBA error on such "normal" lines, it indicates that there is

a
compile error somewhere else in your code, but the IDE picks that line,

for
some unknown reason.
Comment out that line, then do a "Full Compile" and see what others

error(s)
are flagged.

NickHK

"LindhJonas" wrote in message
...
I am using the function Result = Mid(Mystring, Start, lenght) in Visual

Basic.
It is working perfect with an english version of Excel.
The swedish version gives compile error "Cant find the project or

library"
Visual Basic is not avialable in a swedish version .

Is it possible that this function can only be used in english speeking
countries?
Anyone else with this experience or a solution to the problem.

There is no problem if I use Mid as a spread sheet function.
Using Result = Application.WorksheetFunction.Mid(Mystring, Start,

lenght)
in Visual Basic does not help.

Unhappy Swede
Jonas