Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
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