+ Reply to Thread
Results 1 to 1 of 1

Export/Copy a Text File to a Web Server

Hybrid View

  1. #1
    Registered User
    Join Date
    01-05-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Export/Copy a Text File to a Web Server

    I can create a text file from data entered into a UserForm. However, I would then like to copy or export the file to a directory in a server I have on the web.

    I've tried various code snippets from searching on the web without luck.

    The following brings up errors "Bad file name or number" or "Path not found".
    Sub test()
       
       Dim SourceFile, DestinationFile
    
       SourceFile = "d:\Users\Ted\Desktop\test.txt"
       DestinationFile = "//website.ca/Folder/test.txt"
       FileCopy SourceFile, DestinationFile
    
    End Sub
    Also tried DestinationFile = "http://website.ca/Folder/test.txt"
    DestinationFile = "http:\\website.ca\Folder\test.txt"
    DestinationFile = "\\website.ca\Folder\test.txt"

    Appreciate any pointers.
    Thanks
    Last edited by TedN; 12-31-2012 at 02:12 PM. Reason: Please use code tags no matter how small...Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1