June 26, 2016
Hi everyone, my name is Maurizio
And my new problem with vba is this:
On an excel sheet in the column (A10: A14) I have links referable to images extracted from a link.
Now I state that: At the level of the worksheet the images are presented as well as I want.
But the problem now is this: I would like these images to be presented in a cionque Image that are inserted inside a Userform how can this be done?
Thanks as always in advance for all the advice and help you want to give me about it; Greetings from A. Maurizio
(P.S) Clearly I insert my test file
October 5, 2010
Hi Maurizio,
Firstly, please don't tun off error handling with ON ERROR RESUME NEXT without using your own error handlers. I think I've mentioned this before!
To insert a picture into the form you need to use LOADPICTURE and an image saved to disk is required for this. And it has to be a BMP or JPEG, PNG's don't work 🙁
What I would do is save all the images you could use to a folder, rather than load them over the web every time you need one, then just load them into the form control as required.
You haven't got any code that determines how you know what image to load, so I assume you will write that later now you know how to actually load an image into the form.
Regards
Phil
June 26, 2016
Hi Philip Treacy
Thanks as always for your precious advice that you always give me; But I always want to clarify that what I send to you as a forum and always I almost like a draft of my real work.
This is to get right to the point I would like to solve.
As for the concept of error control ("Normalmante use On Error goto etc ...!") What you see in the test listings and just to speed it up; Even if I know it's a risk!
That said, I repeat what was said in the previous message that this is:
If I add my method to the worksheet level; That is, I draw from every link in the column (A10: A14) as in this case and I recall them with my procedure to insert them in the cells that I want to set the whole; Then my listing works fine.
On the contrary if I wanted to insert the same images using a userform then it doesn't work.
But following your advice carefully, another question arises at this point which is this:
1) There would be the possibility of having images inserted at the worksheet level.
2) Then copy and paste them into the Deirectors (C:
3) Present everything as a picture in the user form?
I state that I could recover the images from my directory and present them in the user form; but I wouldn't know how to copy them from the spreadsheet / delete them and paste them in the directory (C:
/P.S) I state that the links that are inserted in the Column (A: A) arrive from the site:
https://www.worldweatheronline.com
Therefore they are Variables that are updated from time to time
Then at the end of it all I will have you get a copy of my work Thank you
October 5, 2010
Hi Maurizio,
the point is it's not practical to load the images into the sheet and then save them out to a folder - but the attached file has a routine to do this.
You should load the images into your browser and save them from there into a folder. Then it's easy to load them into your form as needed.
Regards
Phil
June 26, 2016
Hi Philip Treacy
I write to you only for your project it stops immediately as soon as I press the button Sull'userform; As it gives me an error at this point (Image1.Picture = LoadPicture (NightPic))
He tells me that it is "impossible to find the path !!!!!"
But from your (D 🙂 I had already changed it to (C 🙂
Then anyway it is more than normal that he does not find the file classified as (SunPice and NightPic) as you have taught me that the code (LoadPicture) is used to extract and bring to light an Existing image).
But here it does not exist yet because nothing has been saved yet in the Folder ("C: temp
But don't worry you will see with this that you can at least understand how to save everything before having it recalled by your procedure.
Thank you very much for your support and the time you have been able to dedicate to me, thank you and have a good evening with Maurizio
June 26, 2016
Hi Philip Treacy Listen:
I write to you again because this is the same speech that started with my first post.
And the speech is this: Following your Previous Instructions, and also putting in my own
I have finally come to create what I wanted to do from the beginning, that is: ("Save the images in my workbook")
However, another problem arose that only you can solve, and this is:
1) If I select a single image and then press the button placed on the worksheet; The procedure works great.
2) The problem arises when I wish to export them all together; As nothing happens!
3) for here you could please give her a look and make sure that: When the button on the worksheet is pressed, the 5 Images were exported all in the same folder to which they are selected or not?
Thank you: sincere greetings from Maurizio
This is the link to download the new file :
October 5, 2010
Hi Maurizio,
Because there are a finite number of images I wouldn't bother writing a VBA routine to get them from the web and then save to a folder. The time it takes to do that wouldn't be worth it.
Surely it'd be quicker to just save each image by hand to a folder where they can be loaded into your form/sheet? How many images are there? A dozen?
Isn't the purpose of what you are doing to load images into the form/sheet to indicate the weather for that day?
If Monday is sunny and so is Tuesday, and therefore they both have the same image, why load the weather image from the web for both days and save over the same image each time?
Regards
Phil
June 26, 2016
Hi Philip Treacy
Listen: there for them !!!!!!
You could also be right in affirming what you said.
But the purpose of my work is not so much Picking from the URL I have Link as the Images of the Weather forecast.
But if anything do I learn to save the images I have on the worksheet regardless of whether they are weather forecasts or I have images of my children?
In a nutshell: Since I learned the technique thanks to you: How to take the desired images from a file and insert them into both a Userform and a Worksheet.
Why not learn the Contrary too?
Regardless of how many there are.
But if on the Internet I found something that could do for me; Nothing would be
Instead I need your help because on the internet there is so much dancing, but it doesn't go on the specific Everything here!
And without your help I can't do it Thanks
1 Guest(s)