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".

    1 answer 1

    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:

    1. We have two links to graphic files in MS Excel table MS Excel

    MS Excel file

    1. Call F8 macro ShowPic Macro call

    2. Macro code

       Sub ShowPic() Dim StrtApp As String ' Значение активной ячейки StrtApp = ActiveCell.Value ' Формируем выражение и выполняем RsltCmd = Shell("explorer.exe" + " " + StrtApp, vbNormalFocus) End Sub 
    3. 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.