#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default WEB Link

Hi

I need a excel macro code to enter to the web link and search for particular
xls file and save it to desktop..

I have a web link, when i browse my web link, i will have a list of excel
files which i need to save to my desktop..
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default WEB Link

try this code. when searching a web directory I think youjust need to put //
infront of the filename

strFolder = "//abc.com/mydir"



Public file_loc As String
Sub findfile()
'set MyFilename and strfold as required

'file to search for
Const MyFileName = "xyz.txt"
'directory to start searching
strFolder = "c:\temp"
file_loc = ""
Set fso = CreateObject _
("Scripting.FileSystemObject")
Set folder = _
fso.GetFolder(strFolder)

Call GetWorksheetsSubFolder(strFolder + "\", MyFileName)

MsgBox ("File found in folder: " & file_loc)
End Sub

Sub GetWorksheetsSubFolder(strFolder, MyFileName)
Set fso = CreateObject _
("Scripting.FileSystemObject")

Set folder = _
fso.GetFolder(strFolder)

If folder.subfolders.Count 0 Then
For Each sf In folder.subfolders
On Error GoTo 100
Call GetWorksheetsSubFolder(strFolder + sf.Name + "\", MyFileName)
If file_loc < "" Then Exit For
100 Next sf
End If
'folder size in bytes
On Error GoTo 200
If file_loc = "" Then
For Each fl In folder.Files
If fl.Name = MyFileName Then
file_loc = folder.Name
End If
Next fl
End If
200 On Error GoTo 0

End Sub


"Ranjit kurian" wrote:

Hi

I need a excel macro code to enter to the web link and search for particular
xls file and save it to desktop..

I have a web link, when i browse my web link, i will have a list of excel
files which i need to save to my desktop..

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
Hyperlink Link Field to link to file on website BZeyger Excel Programming 0 May 1st 07 05:06 PM
Updating link to database w/o breaking the link A.Gates Excel Programming 0 January 26th 07 06:55 PM
How to Change External Link to Internal Link Chaplain Doug Excel Programming 3 August 28th 06 04:17 PM
if i sort cell that has link to another page how to keep link steve Bahrain Excel Discussion (Misc queries) 1 August 16th 06 01:20 PM
if i sort cell that has link to another page how to keep link steve Bahrain Excel Discussion (Misc queries) 0 August 16th 06 07:37 AM


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