Create class Tafqeet in vb6 to use it in Excel

How to create a function in VB6 to use it in Microsoft Excel (32bit)

Create function for Excel

(1) Visual Basic 6.0

Create ActiveX Dll Project
Save it [Name: ArabicTools] i.e: c:\project1\ArabicTools.vbp
Close vb6.0, open it from ArabicTools.vbp

Rename 'class1.cls' to 'Tafeet.cls"
Code:

From 'file' => make ArabicTools.dll
From 'Project' => 'Properties'
General
Thread Model -> Apartment Threaded
Compile
Optimize for fast code
Favor Pentium pro(tm)
Component

File-> Save
File-> Make ArabicTools.dll

Close vb6.0

Open command Prompt-> regsvr32 "C:\project1\ArabicTools.dll"

(2) Microsoft Excel 32bit 

New Microsoft Excel workbook-> sheet1 ->Developer menu-> view code
From 'Tools' -> Reference-> look


for 'ArabicTools'-> check it-> OK! - or Browse-> locate it.
Insert new module 'module1'

Code:

Option Explicit
Function Tafqeet(b as Double) as Double
    Dim T As Object
    SET T = CreateObject("ArabicTools.Tafqeet")
Tfqeet = T.AmountToArabicWords(b)
End Sub

Save, from Debug=> Compile VBA project
close vba

Cell a1 -> type 123
in cell 'B1' type =tafqeet(A1)


Tell me the result!!

Comments

VB6 Popular Posts

Visual Basic Online Course - Excel 2003 Part 1

VB 6.0 - Save/Retrieve Images From Access Database

Visual Basic Online Course - ProgressBar Colors

Visual Basic Online Course - Run-time error '3021' : Either BOF or EOF is True, or the current record has been deleted.

Free download Visual Basic 6 Documentation MSDN

VB 6.0 with MS-Access 2003 Copy a record from table to another

Visual Basic Online Course - Create a Phone Book

VB6 Crystal Reports 4.6 Error : Method 'Action' of object 'CrystalCtrl' Failed

Visual Basic Online Course - Temperature convector