+ Reply to Thread
Results 1 to 2 of 2

FileCopy giving bad file name error

  1. #1
    Forum Contributor
    Join Date
    03-15-2016
    Location
    Vancouver, Canada
    MS-Off Ver
    w 10, Excel 2016
    Posts
    125

    FileCopy giving bad file name error

    I’m trying to do a fairly simple copy of a PDF file from one folder to another using “FileCopy”. The challenge is the filename contains an “@” sign (“[email protected]”). While I can manually open the file and save it with the desired filename , if I use FileCopy it throws a “bad file name” error. The code doing the copy is in a loop and works fine for all other filenames without the "@"

    Ive tried both FileCopy and fso.CopyFile

    Please Login or Register  to view this content.
    And
    Please Login or Register  to view this content.
    Both give the error. Is there a better way to simply copy this file over?

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: FileCopy giving bad file name error

    the @ doesnt pose any issues

    im assuming you have both path and FTP_ReportsPath set up correctly (ie path has the full path and filename but FTP_ReportsPath is path only)

    i did note when i copied your code i had to change the " and delete a space
    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Getting Runtime Error 70 during filecopy
    By johnrich23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2016, 03:24 AM
  2. FileCopy error
    By glide2131 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2014, 09:00 PM
  3. [SOLVED] FileCopy Source Error
    By vnzerem in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2014, 04:32 PM
  4. Runtime error 53 on filecopy
    By mwilkes in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-22-2013, 06:19 PM
  5. Filecopy Runtime Error 75
    By Ken S in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2011, 08:34 PM
  6. Error using VBA FileCopy Function
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-20-2010, 03:03 PM
  7. [SOLVED] FileCopy Command Giving "Subscript Out of Range" Error Message
    By Jim Hagan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2005, 02:05 PM

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