Re: VB6 Common Code for Access, Excel and VB Projects
From: Howard Kaikow (kaikow_at_standards.com)
Date: 10/01/04
- Previous message: Gary R. Schmidt: "Re: While studying CS"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 1 Oct 2004 01:59:32 -0400
Yes, you must have the code in a class.
Instantiate the class as, say, YourClass, then qualify each reference to
code with the classname.
E.g., if you have a function GetTodaysDate(), then you call the function
with
x = YourClass.GetTodaysDate().
All VB books should be explaining this.
If you do not have such a book, I suggest Gary Cornell's Visual Basic 6 From
the Ground Up.
-- http://www.standards.com/; See Howard Kaikow's web site. "Tim ffitch" <fia@ifs.inchcape.co.uk> wrote in message news:131ac1c1.0409290040.7ed6a15c@posting.google.com... > Hi > > Thanks for your reply. Perhaps I should have gone into a bit more > detail. I have done what you said but I cant call my functions unless > I instantiate an object from my class and then call the function > procedures from the object. I have tried to create an ActiveX DLL with > standard code modules instead of a class. I have tried this with and > without a class module included as well. If I remove the class module > I am not able to compile the project. > > Any ideas where I may be going wrong? > > Kind regards > Tim ffitch > > "Howard Kaikow" <kaikow@standards.com> wrote in message news:<cjc7i9$e7g$1@pyrite.mv.net>... > > Compile the code to an ActiveX DLL and add a reference to each VBA/VB > > project that requires use of the DLL. > > > > -- > > http://www.standards.com/; See Howard Kaikow's web site. > > "Tim ffitch" <fia@ifs.inchcape.co.uk> wrote in message > > news:131ac1c1.0409280651.1fa6e3c8@posting.google.com... > > > Hi > > > > > > It has been sometime since I have done any pure VB programming. I need > > > to set up in Visual Basic 6 something like a dll that has common > > > functions I can use in Microsoft Access, Excel and VB Projects. I am > > > am sure I did something similar years ago in VB 5. > > > > > > I have created a class which stores all the code for the function > > > procedures but from my projects I have to reference the instance of > > > the class instead of just calling the function. > > > > > > I am sure I did this last time without having to set up a class. I > > > have tried a Standard Exe project but it wont allow me to connect to > > > it. > > > > > > Any ideas please? > > > > > > Kind regards > > > Tim ffitch
- Previous message: Gary R. Schmidt: "Re: While studying CS"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|