0

I have developed a Visual Basic program in Visual Studio that connects to a PostgreSql database using NPGSQL. Now I am trying to do the same in Excel VBA: Using NPGSQL to connect to the PostgreSql database. I guess that I in the VBA editor should use Tools/References to add a reference to some NPGSQL library, but which library should I select?

Alternatively I could perhaps use ADO instead of NPGSQL, but I prefer NPGSQL as it should be more efficient.

3
  • 1
    Have you considered making an add-in with .NET for Excel (VSTO)? You should be able to retain your DB driver that way. Commented Aug 4, 2016 at 14:23
  • 1
    It doesn't appear that NPGSQL has an interface for VBA. Therefore you would not be able to use NPGSQL with VBA. However, it seems that it is written for .NET, so you could use VSTO to write a .NET addin for Excel instead if you feel comfortable doing that. Commented Aug 4, 2016 at 14:23
  • I have now found out how from VBA to read data in a PostgreSQL database. See stackoverflow.com/questions/38876760/… Commented Aug 11, 2016 at 13:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.