question

ASHISHSINGH-6178 avatar image
0 Votes"
ASHISHSINGH-6178 asked BobLarson-6601 answered

Excel - Enhance excel workbook ..

Hi All, I created a workbook with one command button that give a functionality to end user to browse a file and once file chosen its name get highlighted in workbook(yellow color). In my ongoing project I want to enhance it in following manner ..

  1. During clicking on “Choose file” button it should allow to choose only “.txt” file else message should pop up “Invalid file format”.

  2. We should also maintain a log of History like how many files were chosen with their date. If user again going to choose another file then previous file should be moved to below cell with green colour and new one should highlighted with yellow and this manner should continue.

111899-image.png




  1. Also, if user attempted to pick a same file that was already in log with green colour then warning should pop up “File was picked on date ??/??/????.

I attached a sample file so please help how I can add these functionality to it.

office-vba-devoffice-scripts-excel-dev
image.png (15.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

BobLarson-6601 avatar image
0 Votes"
BobLarson-6601 answered

If you use the file picker filter property you would not need to return an error message because only text files would be available.

See here for more about that: https://docs.microsoft.com/en-us/uwp/api/windows.storage.pickers.fileopenpicker.filetypefilter?view=winrt-20348

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.