Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Al
I worked out a way to do this that was just fine ... then my host decided to implement passive ftp transfers and so now it doesn't work :( ... Previously I opened a dummy file whose name I knew using .. Workbooks.OpenText (ftpURL + ftpRootDirectory + "dummy.txt" Close '[ not sure that this is necessary ... but what the heck Workbooks("dummy.txt").Close (False ... this got me a password dialogue box (which is good in this application) .. and then I accessed the list of files with .. With ActiveSheet.QueryTables.Add(Connection:= "TEXT;" + ftpURL + ftpRootDirectory, Destination:=Range("A1") .FieldNames = Fals .RowNumbers = Fals .FillAdjacentFormulas = Fals .PreserveFormatting = Fals .RefreshOnFileOpen = Fals .RefreshStyle = xlInsertDeleteCell .SavePassword = Fals .SaveData = Tru .AdjustColumnWidth = Fals .RefreshPeriod = .TextFilePromptOnRefresh = Fals .TextFilePlatform = 125 .TextFileStartRow = .TextFileParseType = xlDelimite .TextFileTextQualifier = xlTextQualifierNon .TextFileConsecutiveDelimiter = Fals .TextFileTabDelimiter = Tru .TextFileSemicolonDelimiter = Fals .TextFileCommaDelimiter = Fals .TextFileSpaceDelimiter = Fals .TextFileColumnDataTypes = Array(xlTextFormat .TextFileTrailingMinusNumbers = Fals .Refresh BackgroundQuery:=Fals End Wit ... which put the list in an emptied worksheet from where I could parse the list and open each file of interest explicitly using the same method Now that passive ftp is required Excel hangs (of course) on the ... Workbooks.OpenText (ftpURL + ftpRootDirectory + "dummy.txt" All help appreciated, thank Gly |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Suggest you Shell out to an external program to retrieve the files you're
after. I know of one quite good program for pulling data from ftp/web sites: wget -- Rob van Gelder - http://www.vangelder.co.nz/excel "GeeBee" wrote in message ... Hi All I worked out a way to do this that was just fine ... then my host decided to implement passive ftp transfers and so now it doesn't work :( ... Previously I opened a dummy file whose name I knew using ... Workbooks.OpenText (ftpURL + ftpRootDirectory + "dummy.txt") Close '[ not sure that this is necessary ... but what the heck] Workbooks("dummy.txt").Close (False) ... this got me a password dialogue box (which is good in this application) .. and then I accessed the list of files with ... With ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;" + ftpURL + ftpRootDirectory, Destination:=Range("A1")) .FieldNames = False .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = False .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = False .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = 1252 .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierNone .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileColumnDataTypes = Array(xlTextFormat) .TextFileTrailingMinusNumbers = False .Refresh BackgroundQuery:=False End With ... which put the list in an emptied worksheet from where I could parse the list and open each file of interest explicitly using the same method. Now that passive ftp is required Excel hangs (of course) on the ... Workbooks.OpenText (ftpURL + ftpRootDirectory + "dummy.txt") All help appreciated, thanks Glyn |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Rob ... was hoping to avoid all that ... but if it must be ... hi ho ... hi ho
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There definately are ways of opening an FTP connection and transferring
files from a macro. I'm not saying you *must* avoid FTP operations within a macro. I'm just saying that Shell is what I'd do. Perhaps the best reason is you can rely on an external program which has been thoroughly tested (like wget) - that way you don't have to stress and debug whenever an FTP transfer fails. -- Rob van Gelder - http://www.vangelder.co.nz/excel "GeeBee" wrote in message ... Thanks Rob ... was hoping to avoid all that ... but if it must be ... hi ho ... hi ho |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel files in my docs have numbered filenames and are duplicates | Setting up and Configuration of Excel | |||
Accessing cells in other files | Excel Discussion (Misc queries) | |||
using wildcard characters for filenames in externally linked files | Excel Discussion (Misc queries) | |||
why are the help files now remote? | Excel Discussion (Misc queries) | |||
Acquiring filenames for multiple files with GetOpenFilename | Excel Programming |