VSTO 3.0 Get/Change an excel 2007 workbook connection
Posted
by
RQueiroga
on Stack Overflow
See other posts from Stack Overflow
or by RQueiroga
Published on 2009-09-24T16:15:45Z
Indexed on
2010/12/31
0:54 UTC
Read the original article
Hit count: 120
Hi all,
I've struggling to find a way to get and change and excel 2007 workbook connection (Menu Data -> Existing Connections -> Connections on this Workbook).It's a connection (several actually) to a SQL Server and used in a pivot table.
I've tried using Application.ActiveWorkbook.Connections or Globals.ThisWorkbook.Connections but they both return always Null..I've tried in an sheet event as well as in a custom ribbon's button event as well.
The only way left I can think of is use to code a VBA method that does the work and then invoque it in my VSTO code, but it's not very elegant is it...
Thanks in advanced :-)
© Stack Overflow or respective owner