I am trying to write a short macro which can Unprotect/Refresh Data Link/Protect my workbook. I found some very helpful code on Excel Forum and now have a macro which does exactly what I want. The macro operates via a button on the worksheet. However, I now feel it may be necessary to add a "condition". After clicking on the macro button, the workbook is unprotected, the directory path of the file needed to refresh data will show on screen, the user selects (clicks) the file, the data refreshes, the workbook is then protected again. If the user should decide to click on cancel instead of selecting the file, at this point the debug windows appears. Is there a simple short code or msg box that could appear on screen if the user selects cancel, along the lines of "you did not select a file and the data has not been refreshed".
I am completely new to VBA code and apologise if I am unclear in any way. The code I have is as follows:
Thank you for any guidance you can give me on this.
Bookmarks