Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Calling a DLL in MS-Excel

I have the following instructions to call a DLL from Visual Basic. I don't
know how to do this and wondered if someone could assist me or explain to me
in layman's terms how to accomplish it.

Thanks,

Jim

This is the calling routine from Visual Basi
€˜-------------------------------------------------------------------------------------
Option Explicit
Private Sub Command1_Click()
'
trsm = InputBox("enter legal location")
meridian = InputBox("OPTIONAL/enter meridian")
state = InputBox("OPTIONAL/enter state XX")
Call trsm2ll(trsm, Len(trsm), meridian, Len(meridian), state, Len(state),
lat, lng, lerror)
MsgBox "latitude=" & lat & " longitude=" & lng & " error=" & lerror & "
trsm=" & trsm & " state=" & state & " meridian=" & meridian
End Su
€˜---------------------------------------------------------------------------------------------------
And this is the Module declaration.
€˜--------------------------------------------------------------------------------------------
Option Explicit
Public lerror As Integer
Public lat As Single
Public lng As Single
Public state As String * 2
Public meridian As String * 2
Public trsm As String * 16
Declare Sub trsm2ll Lib _
"TRSM2LL.DLL" _
(ByVal trsm As String, ByVal l1 As Long, _
ByVal meridian As String, ByVal l2 As Long, _
ByVal state As String, ByVal l3 As Long, _
lat As Single, _
lng As Single, _
lerror As Integer)

The following Visual Fortran DLLs must be present on you computer:
DFORRT.DLL
DFORMD.DLL
MSVCRT.DLL

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Calling a DLL in MS-Excel

Either the DLLs aren't present on your system and they need to be or they
need to be registered, ex.

regsvr32 DFORRT.DLL


"Jim" wrote in message
...
I have the following instructions to call a DLL from Visual Basic. I don't
know how to do this and wondered if someone could assist me or explain to
me
in layman's terms how to accomplish it.

Thanks,

Jim

This is the calling routine from Visual Basic
'-------------------------------------------------------------------------------------
Option Explicit
Private Sub Command1_Click()
'
trsm = InputBox("enter legal location")
meridian = InputBox("OPTIONAL/enter meridian")
state = InputBox("OPTIONAL/enter state XX")
Call trsm2ll(trsm, Len(trsm), meridian, Len(meridian), state, Len(state),
lat, lng, lerror)
MsgBox "latitude=" & lat & " longitude=" & lng & " error=" & lerror & "
trsm=" & trsm & " state=" & state & " meridian=" & meridian
End Sub
'---------------------------------------------------------------------------------------------------
And this is the Module declaration.
'--------------------------------------------------------------------------------------------
Option Explicit
Public lerror As Integer
Public lat As Single
Public lng As Single
Public state As String * 2
Public meridian As String * 2
Public trsm As String * 16
Declare Sub trsm2ll Lib _
"TRSM2LL.DLL" _
(ByVal trsm As String, ByVal l1 As Long, _
ByVal meridian As String, ByVal l2 As Long, _
ByVal state As String, ByVal l3 As Long, _
lat As Single, _
lng As Single, _
lerror As Integer)

The following Visual Fortran DLLs must be present on you computer:
DFORRT.DLL
DFORMD.DLL
MSVCRT.DLL



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling a new function Excel gives me #NAME? Mark Dvorkin Excel Worksheet Functions 4 July 10th 05 01:29 AM
Calling VB from Excel Ingvar[_2_] Excel Programming 1 October 10th 04 11:46 AM
Calling a VB.NET exe/dll from excel Rui Dias Excel Programming 0 August 11th 04 05:44 PM
Calling Excel from C++ GL[_2_] Excel Programming 1 August 9th 04 09:15 PM
Calling a function from within EXCEL pcor[_2_] Excel Programming 3 July 18th 03 05:10 PM


All times are GMT +1. The time now is 03:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"