473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Error when calling vb dll subroutine from excel vba

I've created the following dll in vb 2008 which doesn't offer an easy com template/project, thus I used project type "Class Library".
Expand|Select|Wrap|Line Numbers
  1. Public Interface IDemo
  2.     Sub doSomething()
  3. End Interface
  4. Public Class implementIDemo
  5.     Implements IDemo
  6.     Dim varAsInterface As IDemo = New implementIDemo()
  7.     Dim varAsClass As implementIDemo = New implementIDemo()
  8.     Private Sub doSomething() Implements IDemo.doSomething
  9.     MsgBox("Hello")
  10.     End Sub
  11. End Class
  12.  
I then used tlbexp.exe, gacutil.exe, regasm,exe, and sn.exe so that the
"doSomething" sub routine could be accessed/called from an excel vba (by
first referencing the tlb file).

My excel vba is as follows:

Expand|Select|Wrap|Line Numbers
  1. Private moTemp As mydll.IDemo
  2.  
  3. Sub trial()
  4. moTemp.doSomething
  5. End Sub
Excel VBA seems to recognize class and subfunction as I'm typing them,
but when I run the "trial" macro I get the following error:

"Run-time error '91': Object variable or With block variable not set"

Have I done everything I need to in vb, and if so does anyone know if the call from excel vba is correct?

Thanks in advance,
Aug 6 '08 #1
2 1121
Curtis Rutland
3,256 Expert 2GB
Please use [code] tags (the # button on the text editor) when posting in this forum.

Please read the Posting Guidelines

MODERATOR
Aug 6 '08 #2
I may have possibly posted this in the wrong forum (judging from the fact that nobody seems to have any knowledge in this area). I'll try elsewhere.

Thanks anyways,
Aug 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Giulio Belrango | last post by:
Hi I need someones help I'm working in an IBM 390 batch environment. What I'm trying to do is to call from a non DB2 COBOL program a DB2 COBOL program that will access a table and perform an...
2
by: Rob G | last post by:
Hi, I am new to this ASP.NET thing and while going very slow, I am learning. Then I got a Configuration Error out of nowhere when I ran my project. I do have Excel as reference (but I haven't...
6
by: Rich Wallace | last post by:
Hi all, I have a VB app that runs and manages individual XLS files within a single COM object. Upon processing the final fie, I attempt to close out the EXCEL object and release it using...
33
by: Anthony England | last post by:
I am considering general error handling routines and have written a sample function to look up an ID in a table. The function returns True if it can find the ID and create a recordset based on...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
0
by: Ned Balzer | last post by:
I have a puzzling problem. I am using some code I found in another thread here to output the results of a gridview to excel. Here is the subroutine: Sub SendToExcel(ByVal Source As Object,...
2
by: luis | last post by:
I'm using ctypes to call a fortran dll from python. I have no problems passing integer and double arryas, but I have an error with str arrys. For example: ..... StringVector = c_char_p *...
1
by: urkel | last post by:
Hi everyone, I critically need help to solve this problem related to pointer in C++ Basically, I have a C/C++ program "retardselfenerg" calling a Fortran 90 subroutine "surfGF4.f90". i am so...
17
by: Blaine | last post by:
I've created the following dll in vb 2008. ___________________________________________________________ Public Interface IDemo Sub doSomething() End Interface Public Class implementIDemo...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.