Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

VB excel macro


  • Please log in to reply

#1
skar313

skar313

    New Member

  • Member
  • Pip
  • 1 posts
I have created a VB macro in excel which calls a dll...I declare the dll using the following statement

Public Declare Sub FCALL3 Lib "C:\My Documents\Debug\FCALL3.dll" (ByRef xyz As Double)

the problem with this declaration is that everytime I transfer the file, I need to keep changing the path to the dll....Is there any way I can declare the dll to be in the same
folder as the excel workbook so that even if I transfer the excel file, I can just transfer the dll to the excel folder and VB automatical reads the dll ?
  • 0

Advertisements


#2
stu_design

stu_design

    Member

  • Member
  • PipPipPip
  • 217 posts
try

dim x as string 

x = Thisworkbook.Path

x = x & "\FCALL3.dll"

Public Declare Sub FCALL3 Lib x (ByRef xyz As Double)

provided that the excel file is located in Debug foldr and that is where dll file is

if does not work, plz post back

sTU dESIGN

Edited by stu_design, 15 June 2005 - 01:01 PM.

  • 0

#3
markd

markd

    New Member

  • Member
  • Pip
  • 4 posts
Hello,


I am new to excel macros and I am trying to call a dll from excel macro. Can you please let me know how to call?

A working code example would be of great help.

pls help.

Thanks,
  • 0

#4
stu_design

stu_design

    Member

  • Member
  • PipPipPip
  • 217 posts
http://msdn.microsof...llfunctions.asp

try here
  • 0

#5
markd

markd

    New Member

  • Member
  • Pip
  • 4 posts
could you pls look into the thread "How to call/ run a dll from excel(2003) macro, How to call/ run a dll from excel(2003)". I think i have moved furhter but still struck.

when I try to access the method defined in the dll, I am getting error msg "Can't find dll entry point Math in c:\test\.....\ClassLibrary.dll. More info is available on the other thread(How to call/ run a dll from excel(2003) macro, How to call/ run a dll from excel(2003)).

pls help
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP