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

How to call/ run a dll from excel(2003) macro


  • Please log in to reply

#1
markd

markd

    New Member

  • Member
  • Pip
  • 4 posts
Can I know like how to call / run a dll from excel macro.

I have created a custom button and when clicking that button I need the dll to be called and executed. I am new to excel and a good working example would help me a lot.

Pls help.

Thanks,
  • 0

Advertisements


#2
markd

markd

    New Member

  • Topic Starter
  • Member
  • Pip
  • 4 posts
Ok. A little bit improvemnet from my previous post.

what I did was I created a dll called ClassLibrary2.dll which is located in say "c:\\test\...\bin\Debug\" directory.

i declared the below in my Excel: (saw this from one of the post here)

Public Declare Sub Math Lib "C:\test\...\ClassLibrary2.dll" ()

and in the button click event I call

Sub btn_click()
call Math
end sub


I am calling a method which is defined inside the dll. But when I run the macro I get an error messge
"Can not find a dll entry point Math in c:\\test\...\bin\Debug\ClassLibrary2.dll"


I created this dll with c# as below:

using System;

namespace ClassLibrary2
{
public class Class1
{
public void Math()
{
Console.WriteLine("hELLO WORLD");
}
}
}


pls help.

Thanks,
  • 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