flemingg62
asked on
Import Photos (jpg) in to excel where the file name in stored in Columns A
Import Photos (jpg) in column X in excel where the file name and Path are stored in Columns A (About 100 rows)
importing 100s of images into excel file looks a bad idea...
may easily corrupt data...
especially images are mid-large size, say, 250KB min
then excel file will be min 25MB!
is there any reason to do that?
may easily corrupt data...
especially images are mid-large size, say, 250KB min
then excel file will be min 25MB!
is there any reason to do that?
excel file will be min 25MBI'm not sure that is true. As a test using the above code I added 100 copies of a 1285 KB picture to a workbook and the workbook size only increased by 5 KB.
I'm not sure that is true. As a test using the above code I added 100 copies of a 1285 KB picture to a workbook and the workbook size only increased by 5 KB
this cannot be real :)
if you insert 100 copies, then probably excel only inserts 1 and 100 links...
+ your image is probably empty, and when zipped it becomes so tiny...
if it is real image, then it will be huge!
here, I inserted 5 images...
moderate sizes...
size is 2.5 MB!
100 such image will make excel file 50MB!
29205293.xlsx
Here is the workbook I created. You'll see that the image is sized to fit in a cell. The code is slightly modified for the purposes of the test.
29205293.xlsm
29205293.xlsm
if we rename excel file as zip and open with winrar/winzip
we will see the images are stored inside
for my sample, here 5 images...
some of them are png (no compression, some jpg, small but cannot be compressed more, it is already compressed)
so, you can just look at the size of 100 images and can estimate what will be the size of excel at the end...
we will see the images are stored inside
for my sample, here 5 images...
some of them are png (no compression, some jpg, small but cannot be compressed more, it is already compressed)
so, you can just look at the size of 100 images and can estimate what will be the size of excel at the end...
Here is the workbook I created. You'll see that the image is sized to fit in a cell. The code is slightly modified for the purposes of the test
I cannot see any images!
it means images are not in excel, just shortcut/link to actual files
and can be seen only on your machine and as long as those files are not moved/deleted/renamed...
this is your excel file, no media/images inside
You are correct that you can't see any images but if you change the code so that it refers to one of your images then you will see them. I'm going to wait until the Askers responds before I comment again.
ASKER
Perfect Thanks But instead of ending the sub for missing photos can it skip to the next line
I having a go myself at it but not very good with vba
I having a go myself at it but not very good with vba
If you delete line 17 it will do that and if you also delete line 16 you won't see the message.
Wait, that's not correct. Be back in a few minutes.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect Thanks
the code is mainly from Martin Liss's post...
that should be selected as assisted at least...
that should be selected as assisted at least...
ASKER
Thanks for clarifying
You’re welcome and I’m glad I was able to help.
If you expand the “Full Biography" section of my profile you’ll find links to some articles I’ve written that may interest you.
Marty - Microsoft MVP 2009 to 2017
Experts Exchange Most Valuable Expert (MVE) 2015, 2017
Experts Exchange Distinguished Expert in Excel 2018
Experts Exchange Top Expert Visual Basic Classic 2012 to 2020
Experts Exchange Top Expert VBA 2018 to 2020
If you expand the “Full Biography" section of my profile you’ll find links to some articles I’ve written that may interest you.
Marty - Microsoft MVP 2009 to 2017
Experts Exchange Most Valuable Expert (MVE) 2015, 2017
Experts Exchange Distinguished Expert in Excel 2018
Experts Exchange Top Expert Visual Basic Classic 2012 to 2020
Experts Exchange Top Expert VBA 2018 to 2020
Open in new window