LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default getURL or open

I have this code that stops when I try to copy the Excel sheet from the
sharepoint SErver to my local desktop. It asks me for the username and login
however when I go to the web site in my browser I can download the excel
spreadsheet without a user name and password. Am I supposed to use another
VBA command like getURL instead of open? I need a copy on my desktop. I
can get the password and login but I want to make sure the code is right.
Thanks,


-----------------code--------

Sub CopySheet()
Dim sharePointURL As String
Dim objExcel, objWorkbook, objWorksheet As Object
sharePointURL = "http://vsps/sites/QEG/default.aspx"
reportTitle = "HSI Capacity Report"
reportDate = "07-0630"
filePath = "c:\\Temp\Segmentation"



Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(sharePointURL)
objExcel.Visible = True

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



ActiveWorkbook.SaveAs Filename:=filePath & reportDate & " " & reportTitle
'ActiveWorkbook.Close
End Sub
 
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
ON OPEN VBA Code input incorrectly now excel sheet wont open mmartin New Users to Excel 1 February 16th 11 11:33 PM
Opening Excel, Book1 opens, remains open with other workbook open DanieB Excel Discussion (Misc queries) 0 September 3rd 09 08:23 AM
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
workbooks.open function fails to open an existing excel file when used in ASP, but works in VB. san Excel Programming 1 January 3rd 06 03:22 AM
How do I stop Excel from closing the open file each time I open a. Welsin Setting up and Configuration of Excel 3 January 8th 05 11:16 PM


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

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

About Us

"It's about Microsoft Excel"