![]() |
Activate Windows explorer
In one of the tools I've created, users can opt to either open a
document or save it to their desktop ... some files are so big that they're only available as .zip files for download. In these cases, I'd like to offer the user an option -- after download, they can either stay in Excel or go to the folder containing the downloaded file ... but how to do that? I've pasted the current code below ... I've figured out how to open Windows Explorer to the proper folder, but I'd like to have Explorer become the top-most item on the DeskTop. I thought I could maybe do it with a SendKeys command (as shown below), but that didn't work as I thought .. Any ideas? Thanks in advance ... Ray ' some other code before this Select Case MsgBox("The selected File has been downloaded successfully ..." _ & vbCrLf & "" _ & vbCrLf & "Would you like to go that file now?" _ & vbCrLf & "YES ... to open the Portal Reports folder" _ & vbCrLf & " NO ... to view the download later" _ , vbYesNo Or vbExclamation Or vbDefaultButton1, "Download Complete!") Case vbYes Shell "explorer U:\Desktop\Portal Reports\" Application.SendKeys ("%{tab}") Exit Sub Case vbNo End Select ' ... other code (Error-handling) after this |
Activate Windows explorer
Answered my own question ... for the archive:
The Shell command should have read: Shell "explorer U:\Desktop\Portal Reports\" , vbNormalFocus This sends the specified Explorer window to the front. |
All times are GMT +1. The time now is 03:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com