Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 52 Bad file name or number - when reading file from FTP

Hi,
My application gets a filename (normally located on the users local drive
(C:\Test\RU012005003.TXT)), opens it and read it. This works without errors.

The User has now moved the file to a FTP site
(ftp://ftp.volvo.se/tovolvo/bengto/RU012005003.TXT) and receives the message:
52 Bad file name or number.
I have traced the code and it stops at: Open bcs_file For Input ....
This is the code:
bcs_file = Application.GetOpenFilename("Text Files (*.txt), *.txt,CSV Files
(*.csv), *.csv,All Files (*.*), *.*", , "Get Flatfile")

If bcs_file = False Then
MsgBox "No file were chosen - the function ends... ", vbExclamation +
vbOKOnly, "Oppps..."
Exit Sub
End If

fileno = FreeFile()
Open bcs_file For Input Access Read As #fileno

Can anyone help me, please.
Regards...Olle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 52 Bad file name or number - when reading file from FTP

you should talk to your systems people about this. You can quite easily map a
network drive letter to an FTP address. This would be seamless to Excel &
your file's address would be just liek any other, eg "H:\..." where H would
be mappe dto the FTP address. We have several such as our counterparts send
data to us via FTP and we consume tha data via sevaral applications,
including excel.

"Olle" wrote:

Hi,
My application gets a filename (normally located on the users local drive
(C:\Test\RU012005003.TXT)), opens it and read it. This works without errors.

The User has now moved the file to a FTP site
(ftp://ftp.volvo.se/tovolvo/bengto/RU012005003.TXT) and receives the message:
52 Bad file name or number.
I have traced the code and it stops at: Open bcs_file For Input ....
This is the code:
bcs_file = Application.GetOpenFilename("Text Files (*.txt), *.txt,CSV Files
(*.csv), *.csv,All Files (*.*), *.*", , "Get Flatfile")

If bcs_file = False Then
MsgBox "No file were chosen - the function ends... ", vbExclamation +
vbOKOnly, "Oppps..."
Exit Sub
End If

fileno = FreeFile()
Open bcs_file For Input Access Read As #fileno

Can anyone help me, please.
Regards...Olle

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
reading from another file and pasting to current file, "combobox" Darius New Users to Excel 1 September 26th 05 07:13 AM
reading from text file to excel file dgoel Excel Programming 0 April 18th 05 06:49 PM
Reading a zip file big t Excel Programming 2 February 16th 05 03:49 PM
Reading from ini file Tammy[_4_] Excel Programming 4 February 8th 04 10:11 AM
Reading from file Asif[_3_] Excel Programming 4 November 16th 03 05:28 AM


All times are GMT +1. The time now is 04:07 PM.

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"