Copy Excel workbook from a sharepoint site

I am trying to copy the used range from a Corporate network sharepoint 2003 list excel workbook and getting a "subscript out of range" error. I know the address is good as I can go there directly. Any Help would be appreciated
Sub CSMCopy()
Dim wb1 As Workbook, wb2 As Workbook
Dim ws As Worksheet
Set wb1 = Workbooks("http://sharepoint.fmr.com/sites/CSMBusinessManagementTeam/default.aspx?RootFolder=%2fsites%2fCSMBusinessManagementTeam%2fShared%20Documents%2fPlanning%20and%20Performance%2fSegment%20Assignments&View=%7bEB37DB38%2dBFFF%2d41B3%2dAF97%2dBBACDD1BB0F3%7d/All_Plan_Assignments-All_Segments.xls")
Application.DisplayAlerts = False
Set wb2 = Workbooks("\\dmn1.fmr.com\FIDFILE\FS093\workgrp\COMMON\Testing and Reporting Services\Help Line\CallAnswer-TC_SDM\Resources\All Plan Assignments - All Segments.xls")
wb1.UsedRange.Copy wb2.Cells

Application.DisplayAlerts = True
End Sub

Open in new window

llawrencegAsked:
Who is Participating?
 
jason987Commented:
I don't think you can use the workbooks object with URLs

Try this instead:

Workbooks.Open Filename:="http://sharepoint.fmr.com/sites/CSMBusinessManagementTeam/default.aspx?RootFolder=%2fsites%2fCSMBusinessManagementTeam%2fShared%20Documents%2fPlanning%20and%20Performance%2fSegment%20Assignments&View=%7bEB37DB38%2dBFFF%2d41B3%2dAF97%2dBBACDD1BB0F3%7d/All_Plan_Assignments-All_Segments.xls"

Then you can refer to the workbooks by name:
Workbooks("All_Plan_Assignments-All_Segments.xls")....

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.