locked
Automate importing of Excel files to Sharepoint 2007. RRS feed

  • Question

  • Good Day,

    Our organization has a system that generates a report daily which is saved in our shared folder. Then the file is manually uploaded in our sharepoint site (SP 2007). We are looking for a way to automate the process of uploading this file into our Sharepoint. Our company does not have a budget for 3rd party applications. Can we automate this process?

    Thanks,

    Mark

    Wednesday, October 2, 2013 1:32 AM

Answers

  • You can write a simple batch script as follows:

    copy "\\Root\SharedFolder\File.xlsx" "\\server\site\Folder\"

    \\Root\SharedFolder\File.xlsx is the source

    \\server\site\Folder\ is the destination

    Best part is that you can also provide wild card characters instead of using file.xslx

    You can create a windows scheduled task that runs the above batch file at a specific time.

    Wednesday, October 2, 2013 1:44 AM
  • You could use a wild card in the batch file as mentioned above.

    So, if you wanted to move all files, you could look at something like

    copy "\\Root\SharedFolder\*.xlsx" "\\server\site\Folder\"

    The * works as a catchall and will move all files with an xlsx extension.  Files with matching file names will just overide or will be added as a new version to the existing one.

    More info on wildcards can be seen here http://www.ahuka.com/?page_id=31
    Wednesday, October 2, 2013 9:45 AM
    Answerer

All replies

  • You can write a simple batch script as follows:

    copy "\\Root\SharedFolder\File.xlsx" "\\server\site\Folder\"

    \\Root\SharedFolder\File.xlsx is the source

    \\server\site\Folder\ is the destination

    Best part is that you can also provide wild card characters instead of using file.xslx

    You can create a windows scheduled task that runs the above batch file at a specific time.

    Wednesday, October 2, 2013 1:44 AM
  • Thank you for that solution however I forgot to mention that our Sharepoint Services is currently being outsourced so we don't have direct access to the server itself. 
    Wednesday, October 2, 2013 1:58 AM
  • You don't need server access for this. It can be run on any machine.

    Only thing to consider is that the account with which you are running the batch file needs to have at least read access on the source and contribute access on the destination.

    Wednesday, October 2, 2013 2:01 AM
  • Thank you for your reply. How about if the destination folder is within a team site?
    Wednesday, October 2, 2013 2:07 AM
  • I don't think it should matter. In order to get the exact destination URL, open that specific folder in Windows Explorer and use the URL path.
    Wednesday, October 2, 2013 2:12 AM
  • Noted on this. We will try this and give you feedback if it works! Thanks alot! 
    Wednesday, October 2, 2013 2:14 AM
  • Hi Nikhil, It worked! However im a little bit new scripting. How can I copy if the filenames of these files varies from the date of each day? (example for today's report (Oct 2) the filename will be 2.xlsx, the tomorrows report will be 3.xlsx) Thanks again for your help!
    Wednesday, October 2, 2013 4:42 AM
  • You could use a wild card in the batch file as mentioned above.

    So, if you wanted to move all files, you could look at something like

    copy "\\Root\SharedFolder\*.xlsx" "\\server\site\Folder\"

    The * works as a catchall and will move all files with an xlsx extension.  Files with matching file names will just overide or will be added as a new version to the existing one.

    More info on wildcards can be seen here http://www.ahuka.com/?page_id=31
    Wednesday, October 2, 2013 9:45 AM
    Answerer