[Last Call] Learn how to a build a cloud-first strategyRegister Now


In vb 6.0 how a declaration to a custom object is error

Posted on 2006-03-23
Medium Priority
Last Modified: 2010-04-07
Dim objCurrency as New Currency

Error: Compile error
Expected Identifier

Any suggestions?
Question by:swansonplace
LVL 33

Expert Comment

ID: 16269573
This is because Currency itself is a reserved datatype for currency values.
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16269575
this could be due to the library (dll) providing the Currency class not being properly added in the project references
please check the project references; and if you can browse (F2) the class library
LVL 33

Expert Comment

ID: 16269583
You can change the class name to another one.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Accepted Solution

Leo Eikelman earned 1000 total points
ID: 16269704
Try using late binding

Dim objCurrency as Object

Set objCurrency = CreateObject("Currency")

If this doesn't work then make sure the dll is registered using regsvr32 "path to the DLL file"

Also check your registery if the dll is registered

Start reg edit ("Start->Run-> type regedit) and navigate to HKEY_CLASSES_ROOT\

Check in that list that your DLL component is registered and that the name of the component is the same as you expect.

Hope that helps,


Author Comment

ID: 16270337
Thank you all very much for your assistance!

Expert Comment

by:Leo Eikelman
ID: 16270473
thank you  :)


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

825 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