Discussion:
Ucase function - Compile error - Can't find project or library
(too old to reply)
Ken Halter
2004-09-20 17:38:25 UTC
Permalink
Migrating VB6.0 code frmo Windows 2000 to Windows XP.
The Compile is failing on a Ucase statement.
Very Bizzar to me...
Isee there is a Reference listed as : "MISSING: WordCtl Type Library".
I cannot find a reference to the associated 'file' that needs to be
registered.
Could someoen please give me a pointer? Thanks!
You'll need to either find that type library or remove the programs'
dependency on it. The UCase$ failure is due to that missing library. You
should be able to locate the file on your Win2k machine so it can be
moved/registered on your XP machine.
--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
Andrew Faust
2004-09-20 17:43:49 UTC
Permalink
Migrating VB6.0 code frmo Windows 2000 to Windows XP.
The Compile is failing on a Ucase statement.
Very Bizzar to me...
Isee there is a Reference listed as : "MISSING: WordCtl Type
Library".
I cannot find a reference to the associated 'file' that needs
to be
registered.
Don't waste your time trying to figure out why the UCase is
failing, becuase it isn't. When there are errors caused by
Missing libraries the compile will error out, however it often
report the error on perfectly fine lines of code. I think it just
throws an error as soon as the compiler figures out there are
missing libraries, and it just so happens that the parser was
working on the UCase statement, when the compiler realized it
wouldn't be able to complete. Thus you get the exception right
there, despite it having nothing to do with your error.

It looks like the Missing Library probably has something to do
with MS Word. If so then install the same version of Word on the
XP machine as you were using on the 2000 machine and see if that
fixes it. If this isn't an option, then you are going to have to
remove the reference and then remove the usage of the objects
from code. In general you don't want to use the Office Objects
unless it's necessary to your app, as any user who uses your app
will also have to have Office installed.

Andrew Faust
jon stav
2004-09-20 18:33:02 UTC
Permalink
Post by Andrew Faust
Migrating VB6.0 code frmo Windows 2000 to Windows XP.
The Compile is failing on a Ucase statement.
Very Bizzar to me...
Isee there is a Reference listed as : "MISSING: WordCtl Type
Library".
I cannot find a reference to the associated 'file' that needs
to be
registered.
Don't waste your time trying to figure out why the UCase is
failing, becuase it isn't. When there are errors caused by
Missing libraries the compile will error out, however it often
report the error on perfectly fine lines of code. I think it just
throws an error as soon as the compiler figures out there are
missing libraries, and it just so happens that the parser was
working on the UCase statement, when the compiler realized it
wouldn't be able to complete. Thus you get the exception right
there, despite it having nothing to do with your error.
It looks like the Missing Library probably has something to do
with MS Word. If so then install the same version of Word on the
XP machine as you were using on the 2000 machine and see if that
fixes it. If this isn't an option, then you are going to have to
remove the reference and then remove the usage of the objects
from code. In general you don't want to use the Office Objects
unless it's necessary to your app, as any user who uses your app
will also have to have Office installed.
Andrew Faust
I had a thought there was something missleading about this...
Hmmm, there are Word / Mail Merges here, but 'the plan is to move the
functionality to Word 2002 (where in Win2k it was working with Word97).

Thanks,
Andrew Faust
2004-09-20 20:18:30 UTC
Permalink
Post by jon stav
I had a thought there was something missleading about this...
Hmmm, there are Word / Mail Merges here, but 'the plan is to
move the
functionality to Word 2002 (where in Win2k it was working with
Word97).
That's definitely your problem. You had the Word97 libraries
being used, but don't have them on the current system. I'll bet
if you installed Word97 on the XP machine all your problems would
go away.

On a side note. If it is possible that your app may be used by
people who don't have Word installed, you may want to switch to
using late binding, so that the app will run fine so long as they
don't try and use the Word specific features.

Andrew Faust
jon stav
2004-09-21 15:47:05 UTC
Permalink
You have hit on my delema;
1) The original "unaltered" VB application(from Win2k) will compile and run
on XP as long as we don't try the Mail Merge activity (Mail Merge stops with
Runtime problems).
2)We (thecompany) need the MailMerge to work under WinXP - Word2002.
3) I built a standalone (prototype) of VB6.0 MailMerge with Word2002 and it
works fine, and fast(wow) using OLEdb methods.
4)When I put the prototype code into the original project, I can't even get
a Clean compile (as mentioned).
Post by Andrew Faust
Post by jon stav
I had a thought there was something missleading about this...
Hmmm, there are Word / Mail Merges here, but 'the plan is to move the
functionality to Word 2002 (where in Win2k it was working with Word97).
That's definitely your problem. You had the Word97 libraries
being used, but don't have them on the current system. I'll bet
if you installed Word97 on the XP machine all your problems would
go away.
On a side note. If it is possible that your app may be used by
people who don't have Word installed, you may want to switch to
using late binding, so that the app will run fine so long as they
don't try and use the Word specific features.
Andrew Faust
Tim Baur
2004-09-20 19:06:14 UTC
Permalink
Migrating VB6.0 code frmo Windows 2000 to Windows XP.
The Compile is failing on a Ucase statement.
Very Bizzar to me...
Isee there is a Reference listed as : "MISSING: WordCtl Type Library".
I cannot find a reference to the associated 'file' that needs to be
registered.
Could someoen please give me a pointer? Thanks!
The face that WordCtl is missing is a different issue.

UCase is a member of a VBA library. Make sure you reference:

C:\WINDOWS\System32\msvbvm60.dll
jon stav
2004-09-21 15:11:02 UTC
Permalink
Yes, this reference is there, too... Thanks!
Post by Tim Baur
Migrating VB6.0 code frmo Windows 2000 to Windows XP.
The Compile is failing on a Ucase statement.
Very Bizzar to me...
Isee there is a Reference listed as : "MISSING: WordCtl Type Library".
I cannot find a reference to the associated 'file' that needs to be
registered.
Could someoen please give me a pointer? Thanks!
The face that WordCtl is missing is a different issue.
C:\WINDOWS\System32\msvbvm60.dll
Randy Birch
2004-09-21 00:39:04 UTC
Permalink
Ensure that the first four selected (in order) items under
project>references are:

visual basic for applications
visual basic runtime objects and procedures
visual basic objects and procedures
OLE automation
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/


"jon stav" <***@discussions.microsoft.com> wrote in message news:2A9D5A4C-2D14-46AB-8C9C-***@microsoft.com...
: Migrating VB6.0 code frmo Windows 2000 to Windows XP.
:
: The Compile is failing on a Ucase statement.
: Very Bizzar to me...
:
: Isee there is a Reference listed as : "MISSING: WordCtl Type Library".
: I cannot find a reference to the associated 'file' that needs to be
: registered.
:
: Could someoen please give me a pointer? Thanks!
jon stav
2004-09-21 15:11:12 UTC
Permalink
All of these are there, as usual... thanks
Post by Randy Birch
Ensure that the first four selected (in order) items under
visual basic for applications
visual basic runtime objects and procedures
visual basic objects and procedures
OLE automation
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
: Migrating VB6.0 code frmo Windows 2000 to Windows XP.
: The Compile is failing on a Ucase statement.
: Very Bizzar to me...
: Isee there is a Reference listed as : "MISSING: WordCtl Type Library".
: I cannot find a reference to the associated 'file' that needs to be
: registered.
: Could someoen please give me a pointer? Thanks!
VKY
2004-09-21 05:21:22 UTC
Permalink
Try this: Change your Ucase to VBA.Ucase, I got the same errors and it
work out for me.

VKY
Migrating VB6.0 code frmo Windows 2000 to Windows XP.
The Compile is failing on a Ucase statement.
Very Bizzar to me...
Isee there is a Reference listed as : "MISSING: WordCtl Type Library".
I cannot find a reference to the associated 'file' that needs to be
registered.
Could someoen please give me a pointer? Thanks!
jon stav
2004-09-21 15:23:03 UTC
Permalink
Hmmm, I tried upgrading the VB6.0 to (SP6)...
I see the same error message pop-up : "Can find Project...."
however now the code window is focusing in another module on a line that
contains a Private Function definition:
"MEB_Function(meb as MaskEdBox,,,,)".
This Looks like this is missing from the same library referenced as
"WordCtl"...
Post by VKY
Try this: Change your Ucase to VBA.Ucase, I got the same errors and it
work out for me.
VKY
Migrating VB6.0 code frmo Windows 2000 to Windows XP.
The Compile is failing on a Ucase statement.
Very Bizzar to me...
Isee there is a Reference listed as : "MISSING: WordCtl Type Library".
I cannot find a reference to the associated 'file' that needs to be
registered.
Could someoen please give me a pointer? Thanks!
jon stav
2004-09-20 17:57:04 UTC
Permalink
Post by Ken Halter
Migrating VB6.0 code frmo Windows 2000 to Windows XP.
The Compile is failing on a Ucase statement.
Very Bizzar to me...
Isee there is a Reference listed as : "MISSING: WordCtl Type Library".
I cannot find a reference to the associated 'file' that needs to be
registered.
Could someoen please give me a pointer? Thanks!
You'll need to either find that type library or remove the programs'
dependency on it. The UCase$ failure is due to that missing library. You
should be able to locate the file on your Win2k machine so it can be
moved/registered on your XP machine.
--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
On the Win2k machine there was no Reference to: WordCtl Type Library.
So, I don't know what file to look for...
All other Reference files listed are on both machines.
Thanks,
jon stav
2004-09-22 11:43:01 UTC
Permalink
I found it! I was reading an article in the knowledg base about looking into
the .vbp file using a text editor, and noticed these two lines at the end of
the working prototype:

Object=Word.Document.8; WINWORD.EXE
Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; mscomctl.ocx
So, I just copied these to the migrating .vbp file and;
This cleared-up the missleading "Can't find project or Library" compile
error...

Thanks very much for all the suggestions!
---------------------
Migrating VB6.0 code frmo Windows 2000 to Windows XP.
The Compile is failing on a Ucase statement.
Very Bizzar to me...
Isee there is a Reference listed as : "MISSING: WordCtl Type Library".
I cannot find a reference to the associated 'file' that needs to be
registered.
Could someoen please give me a pointer? Thanks!
Loading...