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".
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.
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
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
I have code at home that might work, but I can't access it until this evening
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.
Sorry to sound daft but where or what is the saveas helpscreen?
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.
thanks roy I will speak to you tomorrow.
Andy
I've actually found some code by Leith Ross
![]()
Please Login or Register to view this content.
I always use snb's code:
NB. - activate the reference to FTP ActiveX DLL (ASPFTP.DLL)![]()
Please Login or Register to view this content.
- adapt the sting in the code tot your own situation.
- this is only 1 of more than 4 different methods tot accomplish this.
Thanks for the options, I will try them out tomorrow and let you know how I get on.
cheers,
Andy
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.
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.
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?
That Function is browing for folders, why would you need to find a specific file. You can't upload to a file
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.
Something like this
![]()
Please Login or Register to view this content.
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!![]()
The parameteers would determine which type of files to show
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks