Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Comments In A Shared Workbook FILRichie Excel Discussion (Misc queries) 4 June 12th 14 05:30 PM
VBA Code not working on Shared Workbook KC_Cheer_Coach Excel Worksheet Functions 3 April 7th 09 06:09 PM
VBA code shared between .XLS files BitTwiddler Excel Discussion (Misc queries) 2 March 20th 09 04:04 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Code for Inserting Multiple lines Frantic Excel-er Excel Discussion (Misc queries) 0 June 17th 05 06:36 PM


All times are GMT +1. The time now is 10:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"