Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am having trouble running the code below. When I run it my message test
tells me I'm connected. But I still get the Run-time error '1004' Method "Save As' of object _WorkBook failed. I have to go to the Excel open dialog box and Look in: Add/Modify FTP Locations. Click on ftp selction I want, then it prompts me to enter User Name and Password. This is what I am trying to avoid. Maybe I need to use some other way to ftp the file instead of the SaveAs? How else can I do this? "Sami Askar" wrote in message m... I use an ActiveX control from http://www.chilkatsoft.com/ Set chilkatFTP = CreateObject("ChilkatFTP.ChilkatFTP") 'FTP Parameters chilkatFTP.Hostname = hostip chilkatFTP.UserName = username chilkatFTP.Password = password 'Connect chilkatFTP.Connect 'Was the connection successful? If chilkatFTP.IsConnected Then 'lblMessage.Caption = "Connected" ActiveWorkbook.SaveAs Filename:= "ftp://123.456.7.89/path/invoice.dat", FileFormat:=xlTextPrinter, CreateBackup:=False Else lblMessage.Caption = "Not connected" End If "Grant" wrote in message ... How can I test to make sure my FTP connection is connected before I execute my code. Thanks Grant ActiveWorkbook.SaveAs Filename:= _ "ftp://123.456.7.89/path/invoice.dat", FileFormat:=xlTextPrinter _ , CreateBackup:=False |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Grant,
This is what I am trying to avoid. Maybe I need to use some other way to ftp the file instead of the SaveAs? How else can I do this? Just a suggesting, but you could try embedding the username and password in the ftp location: ActiveWorkbook.SaveAs " Regards Stephen Bullen Microsoft MVP - Excel www.oaltd.co.uk |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've tried that and it doesn't work. I get the same run time error.
"Stephen Bullen" wrote in message ... Hi Grant, This is what I am trying to avoid. Maybe I need to use some other way to ftp the file instead of the SaveAs? How else can I do this? Just a suggesting, but you could try embedding the username and password in the ftp location: ActiveWorkbook.SaveAs " Regards Stephen Bullen Microsoft MVP - Excel www.oaltd.co.uk |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Grant,
I've tried that and it doesn't work. I get the same run time error. Darn! Then I guess the only choice is to save the file locally, then transfer it using the FTP control. Regards Stephen Bullen Microsoft MVP - Excel www.oaltd.co.uk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ACTIVE X CONTROL? | Excel Discussion (Misc queries) | |||
Difference between a Forms Control verus Active-X Control | Excel Discussion (Misc queries) | |||
how to set active x control | Excel Discussion (Misc queries) | |||
Tool Tip Text for Form control/ Active-X control | Excel Programming | |||
Active X Control | Excel Programming |