I am working on Windows 10 and Excel 2016. I'm not an expert on VBA but normally managed to get by. However, I'm really struggling this this!
I need to open a JPG file, and view it, from a file path; which I've managed to do:
I need to open a JPG file, and view it, from a file path; which I've managed to do:
Code:
[B]
Shell ("RunDLL32.exe C:\Windows\System32\Shimgvw.dll,ImageView_Fullscreen C:\xxx\xxx\Documents\Images\DSCF1391.JPG")
[/B][\Code]
This works fine but I need the file path to be variable based on a Cell Value within my workbook. I've tried the following:
[Code][B] Dim FilePath As String[/B]
[B] FilePath = ActiveSheet.Range("C4").Value
Shell ("RunDLL32.exe C:\Windows\System32\Shimgvw.dll,ImageView_Fullscreen FilePath")
[/B][\Code]
It seems that the 'Shell' code doesn't recognise the 'FilePath' as a String referring back to C4?
Can anyone assist me in getting a variable file path, based on the cell value, to work in this routine?
Many thanks in advance