tags:

views:

43

answers:

1

I want to connect to a mongodb database using excel macros, does anybody knows how to acomplish this task?

+2  A: 

Simple way is

  1. create a C# dll to interact with Mongo db through available c# drivers.
  2. Make it Com visible (in Assemblyinfo.cs), build it and register it
  3. Go to the excel macro - > visual basic editor
  4. Click tools->reference, and select your registered assembly
  5. And use it in your VBA, like this.

.

Private Sub CallMongo()
    Dim mongoObj As New MyMongoAssembly
    mongoObj.AddItem("adas");
End Sub

thats all..

Cheers

Ramesh Vel