Hi folks,
I am totally new to VB. I would like to create a function in dll (VB6)
which can be called by MS Access and Excel. Please guide me step by step to
create it.

Public function TotalSale(quantity as integer, cost as integer) as integer
TotalSale = quantity*cost*1.3
End function

Thanks in advance.

Tim.

Re: Create function in dll - New to VB world by mayayana

mayayana
Tue May 06 09:31:07 CDT 2008

You can download a VB DLL sample project here:

www.jsware.net/jsware/vbcode.php3#axdll

I don't know anything about Access, or how any other
MS Office program might call an ActiveX DLL. For VBScript
it's best to use only variant or object datatypes in any
public-facing methods.

The sample function you have seems OK as a start. That
should go in you public DLL class (with type 5 instancing).
Though I'm not sure it's a good idea to return an integer
from a function that multiplies the incoming parameters
by 1.3. It looks like you're actually wanting a Currency
type there, since it's apparently dealing with money.

I don't think anyone is going to be willing to write you
a step-by-step guide to DLLs. It might be better to try
it out and then ask about specific problems. And if you need
more help you should ask in:

microsoft.public.vb.general.discussion

This is a VBScript group, which is not the same as VB.

> Hi folks,
> I am totally new to VB. I would like to create a function in dll (VB6)
> which can be called by MS Access and Excel. Please guide me step by step
to
> create it.
>
> Public function TotalSale(quantity as integer, cost as integer) as integer
> TotalSale = quantity*cost*1.3
> End function
>
> Thanks in advance.
>
> Tim.
>



Re: Create function in dll - New to VB world by Jennifer

Jennifer
Tue May 06 09:57:15 CDT 2008

There is a newsgroup for VB 6 that you can go to:
http://groups.google.com/group/comp.lang.basic.visual.misc/topics

You don't have to use Google to get to it, of course. But that's the
way I know. :)


On May 6, 9:18=A0am, Tim <T...@discussions.microsoft.com> wrote:
> Hi folks,
> I am totally new to VB. =A0I would like to create a function in dll (VB6)
> which can be called by MS Access and Excel. =A0Please guide me step by ste=
p to
> create it. =A0
>
> Public function TotalSale(quantity as integer, cost as integer) as integer=

> =A0 =A0 =A0 =A0 TotalSale =3D quantity*cost*1.3
> End function
>
> Thanks in advance.
>
> Tim.


Re: Create function in dll - New to VB world by mr_unreliable

mr_unreliable
Thu May 08 15:50:55 CDT 2008

mayayana wrote:
> I don't think anyone is going to be willing to write you
> a step-by-step guide to DLLs.


For those with some funding remaining in their publication
budget, there is Dan Appleman's "Developing COM/ActiveX
Components with VB6: A Guide to the Perplexed" ($19.95).
See here:

http://www.desaware.com/products/books/com/devcom/index.aspx

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)



and more by mr_unreliable

mr_unreliable
Thu May 08 16:02:29 CDT 2008

There is also a series of articles by microsoft about
developing and using activeX controls. Many of these
date back several years, but then so does actX.
See here:

http://msdn.microsoft.com/en-us/library/aa136657.aspx

You might start with "Microsoft ActiveX Controls Overview"
by Nancy Cluts (no, not klutz, and she is sensitive about
her name -- so no crude jokes):

http://msdn.microsoft.com/en-us/library/ms968501.aspx

cheers, jw


mr_unreliable wrote:
> mayayana wrote:
>> I don't think anyone is going to be willing to write you
>> a step-by-step guide to DLLs.
>
>
> For those with some funding remaining in their publication
> budget, there is Dan Appleman's "Developing COM/ActiveX
> Components with VB6: A Guide to the Perplexed" ($19.95).
> See here:
>
> http://www.desaware.com/products/books/com/devcom/index.aspx
>
> cheers, jw
> ____________________________________________________________
>
> You got questions? WE GOT ANSWERS!!! ..(but,
> no guarantee the answers will be applicable to the questions)
>
>