Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default copy sheet from Server URL

What I'm trying to do is automate the copying of one spreadsheet ("P
History") from a workbook on a Sharepoint server URL and paste to a new
local workbook on a weekly basis.

One problem is the report title:

The title remains the same but they append the date to it. The weekly
report is added to the Sharepoint server every 7 days.
The date is formatted year-monthdate,
for example 07-0717, for today.
Is there a function that will give me the date for each consecutive report?
Somehow I have to calculate the correct one if it is possible in order to
copy the correct sheet.
I don't know if it is possible to copy this report directly off the server?

The second problem is I am not quite sure I have the code right to do the
copy.
-------------------code-----------------------------

Option Explicit
Dim ReportTitle, FilePath As String
Dim ReportDate As Date


Sub CopySharePointSheet()
Set ReportTitle = "My Report Name"
Set ReportDate = 07-????
Set FilePath = "c:\\Temp\"



Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(HTTP://my web site/ReportDate
ReportTitle)
objExcel.Visible = True

Set objWorksheet = objWorkbook.Worksheets("P History")
objWorksheet.Copy


ActiveWorkbook.SaveAs Filename:=ReportDate + ReportName + FilePath
'ActiveWorkbook.Close
End Sub



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
How do I copy a folder from a server using a macro macrowriter Excel Programming 6 May 4th 10 06:22 PM
Can not copy the file from server to my local C:\ Frank Situmorang Excel Discussion (Misc queries) 3 July 25th 07 12:40 PM
listing server of demain in sheet sal21 Excel Programming 1 March 22nd 07 10:15 AM
Sheet construction on server security issue Jim McLeod Excel Programming 1 April 21st 04 01:41 PM


All times are GMT +1. The time now is 08:23 AM.

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"