0

first time poster here

I am looking for a specific VBA solution and I just can't seem to google my way to the exact code I need - thus, I come here

I have an excel sheet with an existing connection to a sharepoint database. It calls this connection "toolbase"

I need code so that when this sheet loads up it fills its second sheet with a dump from that connection as if I pressed the Existing Connection > Connect > import table button. Its the only known connection to the sheet.

That's it - and for the love of my feeble VBA skills then I can't find the code for this. My boss just wants a list that refreshes itself every time the file loads. I know where to put the code - I just don't what to write.

Can someone help me out?

EDIT:

The closest I could find to what I think I need is something akin to this: https://support.microsoft.com/en-us/kb/306125

but that seems to be talking about extracting records - I need the whole table

Community
  • 1
  • 1
webkilla
  • 11
  • 1
  • You need to at least make some sort of attempt, then post here on what you are stuck with. – Alec. Nov 16 '16 at 13:20
  • That's the issue - I have no clue what kind of commands I'm supposed to start with here. I know how to wrangle your usual run of the mill excel VBA, to set up buttons, open and close forms, you know: Basic stuff. If I knew what kind of commands I was looking for - I wouldn't be asking for them - you must forgive me if that comes off as haughty or ignorant – webkilla Nov 16 '16 at 13:28
  • Perhaps try this http://stackoverflow.com/questions/7876178/importing-excel-spreadsheet-data-into-another-excel-spreadsheet-containing-vba ...or Googling more, there is tons of information about pulling data into a worksheet. Look at the code that comes up, and then Google commands you aren't familiar with to see if it is what you need...you know the way that everyone has to do it. SO is not a code writing service, so you likely won't get the exact code you want here either. – Rdster Nov 16 '16 at 14:09

1 Answers1

0

Once the data connection has been made, just have ActiveWorkbook.RefreshAll assigned when the workbook opens.

You do need to show some research effort or attempted coding in future questions though (even if it's wrong) as this is not a free coding service (i let you off this time as the answer is a one liner ^^).

Glitch_Doctor
  • 2,994
  • 3
  • 16
  • 30