Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Comments on this code to FTP save, please?

Excel 2002
WinXP Home
Win2000

Hi. I see from the archives this has been asked many times, but I ended up
with a different solution than those I read and would like feedback. (Maybe
this has been suggested and I didn't see it.) Like others, I need to edit a
workbook and then save it to an FTP site. I want code to do that, hopefully
simple code.

I found (without code) I could initially save it to an FTP site, and "save
as" code would successfully resave it to the FTP site. But upon reopening my
file from my hard drive I found the "save as" code erred, as though it could
not negotiate contact with the FTP site.

But I also found that if I first opened a file from the site (got a session
going) the code worked beautifully. So, as a rigged solution, I simply added
code that would do that very thing. And it works.

It seems too simple, so I'm asking for comments. Would you please look at
this short code and tell me your thoughts as to potential problems/success.
Thanks.

Notes:
- I left out error handlers & screen update.
- ftp://www.myftp.com is an alias for a real FTP site.
- Empty.xls is a blank workbook.
- Budget.xls is the subject workbook being edited.
- I also left out code that saves file to the hard drive (in addition to
saving to FTP).

Here's the code:

Sub SaveToFTP()

'Open a file from FTP site.
Workbooks.Open Filename:="ftp://www.myftp.com/files/Empty.xls"
'Dialog box asks for password and opens file.
'Close file.
ActiveWorkbook.Close

'Save budget file to FTP.
ActiveWorkbook.SaveAs Filename:= _
"ftp://www.myftp.com/files/Budget.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Thanks again,
Pat Beck



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
How do I color code comments in cells on Excel spreadsheet? LBH Excel Worksheet Functions 1 September 27th 09 05:04 PM
Any way to Display Comments when doing a Save as Web Page? Mr B[_2_] Excel Discussion (Misc queries) 1 April 7th 08 03:07 AM
Code crashes after clearing comments L. Howard Kittle Excel Worksheet Functions 2 February 20th 06 04:54 AM
INSERT COMMENTS WONT SAVE AMBAZ Excel Worksheet Functions 2 December 14th 05 03:57 AM
save comments to a worksheet IM_CRice Excel Worksheet Functions 5 January 7th 05 10:37 PM


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