Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting a shared list from code
How do I insert an existing list from a SharePoint site into an Excel worksheet using VBA? I think the following code should work, but when I run it I always get "Can't connect to the server at this time.
Sub InsertList( Dim wb As Workboo Set wb = Workbooks.Add( Dim ws As Workshee Set ws = wb.Worksheets("Sheet1" Dim str As Strin Dim src(2) As Varian src(0) = "http://wombat.sharepointsite.com src(1) = "Test List src(2) = " ws.ListObjects.Add xlSrcExternal, src, True, xlYes, ws.Range("A1" End Su Another thing: When I do this manually (trying to record the action) Excel removes all of the VBA code from the workbook. That's why I added code above to create a new workbook (I thought maybe that was the trick). No luck.. I'm sure my Sharepoint site is working and that the list is accessable -- since I can do this task manually from the list Web page Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting Comments In A Shared Workbook | Excel Discussion (Misc queries) | |||
VBA Code not working on Shared Workbook | Excel Worksheet Functions | |||
VBA code shared between .XLS files | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
Code for Inserting Multiple lines | Excel Discussion (Misc queries) |