+ Reply to Thread
Results 1 to 19 of 19

Upload files in excel

  1. #1
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Upload files in excel

    Is it possible to upload files to a server for example X:\tempnel by clicking on a button on an excel sheet and selecting the file as you normally would? It would then display the file name in the cell next to the button "S37".
    Last edited by mcinnes01; 10-20-2010 at 04:02 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Upload files in excel

    Can you use saveas?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Upload files in excel

    Hi Roy,

    I have had a quick scan around about how to use the save as function but most of my findings refered to creating a new workbook and using saveas to choose where to save it. I want to upload pdfs and word docs is this possible and could you kindly point me in the right direction or explain how I go about doing this?

    Many thanks,

    Andy

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Upload files in excel

    I have code at home that might work, but I can't access it until this evening

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Upload files in excel

    In the SaveAs helpscreen you can select the folder in which to store a file. There you can add FTP-sites (option at the bottom of the folders' list). After having done so you can select the FTP-site as if it's a folder on your system. Then your file will be uploaded.



  6. #6
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Upload files in excel

    Sorry to sound daft but where or what is the saveas helpscreen?

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Upload files in excel

    I think he is referring to the SaveAs Dialog when manually saving as. There are options to save to My network places & My Site.

    I have code at home to FTP from VBA, I'll check them out tonight.

  8. #8
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Upload files in excel

    thanks roy I will speak to you tomorrow.

    Andy

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Upload files in excel

    I've actually found some code by Leith Ross

    Please Login or Register  to view this content.

  10. #10
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Upload files in excel

    I always use snb's code:

    Please Login or Register  to view this content.
    NB. - activate the reference to FTP ActiveX DLL (ASPFTP.DLL)
    - adapt the sting in the code tot your own situation.
    - this is only 1 of more than 4 different methods tot accomplish this.

  11. #11
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Upload files in excel

    Thanks for the options, I will try them out tomorrow and let you know how I get on.


    cheers,

    Andy

  12. #12
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Upload files in excel

    Right I have finally got round to doing this, I was wondering rather than uploading the file to a server or folder etc is there a way that people could click a button to upload a file and then select the file location as you would when saving a file normally.

    BUT**** then just copy the string to the cell next to this button e.g. cell R20 and then when they click a button at the bottom which emails a csv file to HR it will also attach the file at the end of this string to the email?

    Therefore I don't really need to upload it anywhere merely select a file to be attached to an email.

  13. #13
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Upload files in excel

    I found this and tweaked it and it works perfectly thanks to j-walk!

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Upload files in excel

    one slight issue I have is that this code is only letting me select a folder, where as I need to select any type of file within that folder.

    Does anyone know what I need to add / change / remove from the code?

  15. #15
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Upload files in excel

    That Function is browing for folders, why would you need to find a specific file. You can't upload to a file

  16. #16
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Upload files in excel

    What I want to do is allow users to select a file by clicking on a button then the file browser will popup. When they select a file it will return the file path to the cell "PDESC". Later on this file path will be used to attach the file to an email in the email script.

    Currently as you said the code I have allows you to select a folder but not a file within a folder and so it only returns the directory path, I need to return the full file path.

    Also to cofirm, in my email script if I use the cell "PDESC" as the file string for the attachment, will it work and attach the file? The file could be in any format.

  17. #17
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Upload files in excel

    Something like this
    Please Login or Register  to view this content.

  18. #18
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Upload files in excel

    Hi Roy,

    That works perfectly as I intended and is much more simple than the other solution I had.

    All I did was remove the msgbox at the end and set the cell I needed to = fn

    Why might you want to add parameters to the getopenfilename?

    Also will I now be able to use that cell with file path in to attach a file to an email?

    Thanks again roy!

  19. #19
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Upload files in excel

    The parameteers would determine which type of files to show

+ 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