Create class Tafqeet in vb6 to use it in Excel
How to create a function in VB6 to use it in Microsoft Excel (32bit)
(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