Results 1 to 5 of 5

Thread: [RESOLVED] Show users Excel file template/sample

  1. #1

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,478

    Resolved [RESOLVED] Show users Excel file template/sample

    Hi, an easy question for a change. My users are giving me an excel file to import. I expect certain things in certain columns that they always get mixed up. What is the best way to have the code present a sample file or template that they must adhere to? I recall doing this a long time ago at another job. But when I googled it, I couldn't find anything like how I had done it, or how I wanted to do it. Thanks.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  2. #2
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    Re: Show users Excel file template/sample

    Hello,

    You could create a template (.xltx) that you protect by a password so they can just fill it and not modify it. You call it with your application and they will have to save it with a new name and so the original template won't be destroyed

    regards
    Last edited by Delaney; Jul 21st, 2020 at 03:34 PM.
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

  3. #3

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,478

    Re: Show users Excel file template/sample

    If it's password protected and they can't modify it, how do they save it? Unless you are saying I would present the blank template, and they would fill in the columns? I don't know if they prefer creating an excel file. Then they can save that and reprocess it if something goes wrong. Right? Or save it to have an audit trail. I'll think about some more, though. Thanks.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  4. #4
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    Re: Show users Excel file template/sample

    here is an example of protected worksheet

    example.zip

    you can only fill the 3 yellow cells and save the file. I didn't put any password so you can remove the protection easily
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

  5. #5

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,478

    Re: Show users Excel file template/sample

    @Delaney, thanks for the help. I ended up going with the DevExpress XtraSpreadsheet.SpreadsheetControl. We use DX controls throughout the application so I had this control readily available and it keeps the application consistent and does exactly what I wanted. https://docs.devexpress.com/WindowsF...es/spreadsheet
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

Posting Permissions

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



Click Here to Expand Forum to Full Width