?
Solved

Writing COM Add In for Excel with VB6

Posted on 2011-02-27
3
Medium Priority
?
377 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 2000 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

770 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