cd18___
cd18___

Reputation: 31

Image Files only accepting .bmp Issue

When I programmed my code to make the user upload a picture, I tried to code it to get all image files, but it seems to only accept .bmp files. So how can I code this for the sheet to accept all file types (.png, .jpg, .bmp, etc.)?

imagefileformat = "Image Files (*.bmp),others, png (*.png), *.png, tif (*.tif),*.tif, jpg (*.jpg),*.jpg, All Files (*.*),*.*"
myPictureName = Application.GetOpenFilename(imagefileformat)

Upvotes: 0

Views: 272

Answers (1)

cd18___
cd18___

Reputation: 31

Syntax is critical (and weird in this case, IYAM). Try

imagefileformat = "Image Files (*.bmp; *.png; *.tif; *.jpg),*.bmp;*.png;*.tif;*.jpg"

https://www.reddit.com/r/vba/comments/p65tq5/image_files_only_accepting_bmp_issue/h9av4qw/?utm_source=share&utm_medium=web2x&context=3

Upvotes: 1

Related Questions