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

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