How can I send the value in Run to VBA?
For example, a value can be either a Web-link to a picture, or a local link to a picture, and I, in order not to bother, would like to provide this with "Run".
When invoked, use the Shell(pathname[,windowstyle]) command Shell(pathname[,windowstyle]) , where
pathname - " explorer.exe " + "" + <Web-ссылка на картинку> or <Локальная ссылка на картинку> ;
windowsstyle is a window parameter in which " explorer.exe " is launched (minimized, open to the entire monitor, etc.).
Example:
MS Excel table MS ExcelMacro code
Sub ShowPic() Dim StrtApp As String ' Значение активной ячейки StrtApp = ActiveCell.Value ' Формируем выражение и выполняем RsltCmd = Shell("explorer.exe" + " " + StrtApp, vbNormalFocus) End Sub As a result, explorer.exe , depending on the value of the cells ( StrtApp ) in accordance with the settings of the OS, will launch the application for displaying the graphic file.
Source: https://ru.stackoverflow.com/questions/522001/
All Articles