SkyGod
New Member
- Joined
- May 18, 2020
- Messages
- 9
- Office Version
- 365
- Platform
- Windows
Hello there,
I've a main folder named "main".
I bring the image on userform by textbox1.value.
Well i wanna change the codes a little,
I will make a folder with spesific names in main folder. I will put the pics inside their spesific named folder and i wanna bring the image on userform with tetxbox1.value.
../main/x1
../main/x2
etc
if textbox1.value = x1 then go to main/ x1/ sub folder and chose the first picture or random one. Like this. depends textbox1.value
Thank you for help.
I've a main folder named "main".
I bring the image on userform by textbox1.value.
VBA Code:
Dim obj_fso As Object
Dim myPath As Variant
Dim folderPath As Variant
folderPath = ThisWorkbook.Path & "\main\" & TextBox1.Text & ".jpg"
Set obj_fso = CreateObject("Scripting.FileSystemObject")
Dim cmd As String
If obj_fso.fileExists(folderPath) = True Then
cmd = "RunDLL32.exe C:\Windows\System32\Shimgvw.dll,ImageView_Fullscreen " & folderPath
Shell cmd, vbMaximizedFocus
Else
MsgBox "No pic!", vbExclamation, "Error"
End If
Well i wanna change the codes a little,
I will make a folder with spesific names in main folder. I will put the pics inside their spesific named folder and i wanna bring the image on userform with tetxbox1.value.
../main/x1
../main/x2
etc
if textbox1.value = x1 then go to main/ x1/ sub folder and chose the first picture or random one. Like this. depends textbox1.value
Thank you for help.
Last edited: