Solved

Writing COM Add In for Excel with VB6

Posted on 2011-02-27
3
372 Views
Last Modified: 2012-05-11
Thanks to rorya I have worked through Chip Pearson's tutorial on creating COM AddIn with VB6. It's a good example of Automation Add In.

I'd need to go a little further. I read somewhere that you can create VBA code for Excel from VB6 itself. That is, so I can debug and (hopefully) have Intellisense also. Is this possible? If so can someone direct me to a learning source please?

Info: So far, I have copied and pasted VBA code from the VBE to the Class in VB6. I can make simple things like 'show a message box' work. For data access with ADO etc. (which I can do in Excel VBA) I need to be able to write my code in VB6 just like I do in VBA, test etc. (This is so that I can make a COM AddIn to work with Excel 2010)

Thanks!
0
Comment
Question by:hindersaliva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Expert Comment

by:wellous
ID: 34992623
Hi hindersaliva,
Please read Integrating with COM Applications for detailed information about how to call WCF service from VB6/VBScript client application.
http://msdn.microsoft.com/en-us/library/ms733928.aspx 
Windows Communication Foundation (WCF) services can be integrated directly into your existing code by using the WCF service moniker. The service moniker can be used from a wide range of COM-based development environments, such as Office VBA, Visual Basic 6.0, or Visual C++ 6.0.

You need to check whether the Initialize requires the parameter in this scenario. About configuration file, you need to place the binding definitions (generated by the ServiceModel Metadata Utility Tool (Svcutil.exe) in the generated client application configuration file) in the client application's configuration file. For example, for a Visual Basic 6.0 executable named CallCenterClient.exe, the configuration should be placed in a file named CallCenterConfig.exe.config within the same directory as the executable. The client application can now use the moniker.

If you have any further issues, feel free to tell us.
Brgds
Wellous
0
 
LVL 5

Accepted Solution

by:
wellous earned 500 total points
ID: 34992658
Hi,
It's me again, also pls check these sites if you need something simple tasks.
Good luck

http://theopensourcery.com/vb12tut.htm
http://www.programmersheaven.com/mb/vba/359929/359929/applying-vb6-to-excel/
-------------------------------------------------------------------------------------------------
Also read here about how To Use ADOX with Excel Data from Visual Basic or VBA
http://support.microsoft.com/kb/303814/EN-US

Tks, Wellous
0
 

Author Closing Comment

by:hindersaliva
ID: 34992807
Simple as it was this one gave me the missing link. Perfect!

http://www.programmersheaven.com/mb/vba/359929/359929/applying-vb6-to-excel/

You guys are fantastic.
Thanks Wellous.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question