Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Copy .xls betwen local disk and https:// location

I'm trying to find a way to copy files back and forth between my local disk
and a https:// network location that requires ID an password. After some
research through this forum I was able to find some pieces of code that
allowed me to save a file to the network via "Save As". The problem is that
I'd like to keep the same time stamp between the local file and its copy in
the network... I've tried FileCopy, Copyfile, etc... nothing seems to work
when I try to copy the file instead of doing "Save As". Any suggestions? Beow
you'll find the code I have so far:

Sub test2()

Dim source As String
Dim destination As String

Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = False
.Navigate "https://myprotectedsite.com/"
Do Until .ReadyState = 4
DoEvents
Loop
Set ipf = .Document.all.Item("_ctl1:email")
If ipf Is Nothing Then GoTo skiplogin:
ipf.Value = "
Set ipf = .Document.all.Item("_ctl1:password")
ipf.Value = "mypwd"
Set ipf = .Document.all.Item("_ctl1:SigninBtn")
Do Until .ReadyState = 4
DoEvents
Loop
ipf.Click
Do Until .ReadyState = 4
DoEvents
Loop
End With
skiplogin:
source = "C:\Mylocalfolder\test.xls"
destination = "https://myprotectedsite.com/test.xls"

FileCopy source, destination ' - Run time error 52 - Bad file name or
number

ie.Quit

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Copy .xls betwen local disk and https:// location


Hi,
I don't think you can do a copy or filecopy to a http server. FTP maybe.
Windows does have a "web folders" add-on. I think it was an Office add-on.
You would need to be accessing the web server as a remote drive.

John


"avardaneg" wrote in message
...
I'm trying to find a way to copy files back and forth between my local
disk
and a https:// network location that requires ID an password. After some
research through this forum I was able to find some pieces of code that
allowed me to save a file to the network via "Save As". The problem is
that
I'd like to keep the same time stamp between the local file and its copy
in
the network... I've tried FileCopy, Copyfile, etc... nothing seems to work
when I try to copy the file instead of doing "Save As". Any suggestions?
Beow
you'll find the code I have so far:

Sub test2()

Dim source As String
Dim destination As String

Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = False
.Navigate "https://myprotectedsite.com/"
Do Until .ReadyState = 4
DoEvents
Loop
Set ipf = .Document.all.Item("_ctl1:email")
If ipf Is Nothing Then GoTo skiplogin:
ipf.Value = "
Set ipf = .Document.all.Item("_ctl1:password")
ipf.Value = "mypwd"
Set ipf = .Document.all.Item("_ctl1:SigninBtn")
Do Until .ReadyState = 4
DoEvents
Loop
ipf.Click
Do Until .ReadyState = 4
DoEvents
Loop
End With
skiplogin:
source = "C:\Mylocalfolder\test.xls"
destination = "https://myprotectedsite.com/test.xls"

FileCopy source, destination ' - Run time error 52 - Bad file name
or
number

ie.Quit

End Sub


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
VBA to save a web page to local disk Ron Excel Discussion (Misc queries) 0 April 26th 06 05:18 PM
Download files from 3.5 disk in excel but system said disk need fo DG Excel Discussion (Misc queries) 0 August 13th 05 04:16 PM
COPY DISK TO EXCEL WENDYDOG New Users to Excel 2 January 5th 05 10:06 PM
Inconsistent Behavior on Web vs. Local Disk D. A. Gray Excel Programming 0 July 27th 03 08:13 PM
Clear destination, then copy betwen workbooks John Wilson Excel Programming 3 July 22nd 03 02:41 PM


All times are GMT +1. The time now is 02:14 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"