Manage Photos (add,edit,delete..) through userform


"Excel VBA Help"

 


Play Friv Now - Play Friv Games
Go Back   The Code Cage Forums > Microsoft Topics > Microsoft Excel Forum
Our Info Pages:-
The Code Cage - Microsoft Office help

Notices

Microsoft Excel Forum Members Post questions in this forum if they are related to using Microsoft Excel, this includes Worksheet Functions, Excel VBA Programming, Simple Macro Code & Charting, Excel formula etc.

New Reply
Thread Tools Rate Thread Display Modes
  #1  
Unread 13th March 2017, 17:53
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.34
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Manage Photos (add,edit,delete..) through userform
     Excel: VBA   


------ Register to get rid of these "In Post" ads! ------

Category: Excel: VBA   

Hi everybody.
What I'm trying to do, is something like this:
One worksheet "Dados" with client information and 6 cells for store images (Foto1,Foto2...Foto6)
One userform (FrmRegistos) with the correspondent fields to that worksheet in a Multipage object.
What I want?
1 - I want that when I open frmRegistos and when i do a search using the processo number or code number) the images from that client (and only from that) will appear on the form,
2 - Then I could add, edit or delete those images on the userform, and finally
3 - I could save them back to the worksheet

Is this possible? I hope so, and I beg for your solutions.
I attach an example of what I already did

Thank you very much
Attached Files To view attachments in this forum your post count must be 2 or greater. You currently have 0 posts.

The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!

  #2  
Unread 14th March 2017, 08:07
RoyUK's Avatar
RoyUK RoyUK is offline
Administrator
Solution Centre Professional
MS Office Version: MS Office 2003, 2007, 2010
MS Office Skill Level: Proficient with MS Office
 
Join Date: Nov 2008
Location: Derbyshire, UK
Posts: 2,706
Posts Per Day: 0.87
My Top Tip Count: 4
Thanks to others: 2
Thanked 195 Times in 193 Posts
Reputation: 3320 (69) RoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond repute
4 Top Tips
England
Default Re: Manage Photos (add,edit,delete..) through userform

------ Register to get rid of these "In Post" ads! ------


In what way do you expect to Edit the photos in Excel?
__________________
Hope that helps, RoyUK
For tips & examples visit free excel help
DatabaseForm
About me

  #3  
Unread 14th March 2017, 16:16
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.34
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Manage Photos (add,edit,delete..) through userform

------ Register to get rid of these "In Post" ads! ------


Sorry,
It was a malunderstanding.
When I said "edit", I should have said "change" one or several, not as "edit" like in other programs that edit photos.
Sorry and thank you for being with atention to this errors.
Do you have any suggestion?
Regards

------------------------------ posted after 2 Hours 2 minutes of original post ------------------------------

Hi RoyUK,
I did same reachearch on the Net, I already know how to upload pictures:
Dim fname As String
'Display the Open dialog box.
fname = Application.GetOpenFilename(filefilter:= _
"JPG Files(*.jpg),*.jpg", Title:="Seleccione a Imagem que quer Agregar a esta Frame")
'If you did not click Cancel...
If fname <> "False" Then
Dim pic
Set foto1.Picture = LoadPicture(fname)
and How to delete them:

foto1.Picture = LoadPicture("")
Now the problem is how to send them to the worksheet (when inserting a new record) and how to load them from the worksheet to the userform (when editing one selected record). Can you help me!
thanks


Last edited by silvapereira; 14th March 2017 at 16:16.
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!

  #4  
Unread 14th March 2017, 18:14
RoyUK's Avatar
RoyUK RoyUK is offline
Administrator
Solution Centre Professional
MS Office Version: MS Office 2003, 2007, 2010
MS Office Skill Level: Proficient with MS Office
 
Join Date: Nov 2008
Location: Derbyshire, UK
Posts: 2,706
Posts Per Day: 0.87
My Top Tip Count: 4
Thanks to others: 2
Thanked 195 Times in 193 Posts
Reputation: 3320 (69) RoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond repute
4 Top Tips
England
Default Re: Manage Photos (add,edit,delete..) through userform

------ Register to get rid of these "In Post" ads! ------


Do you mean something like this?

Photos are stored in a sub folder called Images
Attached Files To view attachments in this forum your post count must be 2 or greater. You currently have 0 posts.
__________________
Hope that helps, RoyUK
For tips & examples visit free excel help
DatabaseForm
About me

  #5  
Unread 16th March 2017, 11:24
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.34
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Manage Photos (add,edit,delete..) through userform

------ Register to get rid of these "In Post" ads! ------


Hi RoyUk,
Thanks for your reply. A lot of beautiful VB, and it take me a while trying to understand it. I suppose that is userform2 that you give me as an example, because the other two I think they are interconnected and don't work because don't have sheet1.

Well what I have in mind was a litle different:
In the userform I upload pictures from diferent folders in different paths (computer, cloud ...) and they are displayed on the userform (I know how to do this, OK).
Now, after inserting all the other data (process, name, age, city, etc) I want to save all the information to the Worksheet. I don't know how to save the picture to a cell (like it was embedded on the cell - similiar to a database).

So, when I search for that record all the data including the pictures will appear on the userform.
So what I mean is, save the picture not the path, to a cell. I know this will make a huge excel file, but that is not a problem.

Is this possible in excel?
Don't forget I'm in the stone age of VBA compared to you
Thanks once again

  #6  
Unread 16th March 2017, 18:10
RoyUK's Avatar
RoyUK RoyUK is offline
Administrator
Solution Centre Professional
MS Office Version: MS Office 2003, 2007, 2010
MS Office Skill Level: Proficient with MS Office
 
Join Date: Nov 2008
Location: Derbyshire, UK
Posts: 2,706
Posts Per Day: 0.87
My Top Tip Count: 4
Thanks to others: 2
Thanked 195 Times in 193 Posts
Reputation: 3320 (69) RoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond repute
4 Top Tips
England
Default Re: Manage Photos (add,edit,delete..) through userform

------ Register to get rid of these "In Post" ads! ------


The usual wayis to store the images in a folder and only a link in the sheet, that;s what databases do and the example works that way. I'll have a look later, it's an old example.
__________________
Hope that helps, RoyUK
For tips & examples visit free excel help
DatabaseForm
About me

The Code Cage Advertisment
Advertisement
  #7  
Unread 19th March 2017, 20:48
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.34
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Manage Photos (add,edit,delete..) through userform

------ Register to get rid of these "In Post" ads! ------


Hi again,
I did some research on internet and I think excel doesn't recognize the picture in the cell, only the path, and for that we can't do what I proposed to.
So my question now is:
Can I pic the Picture to the userform from diferente places (and I know this is possible) and then when I save it to the worksheet, give it the path that I want?
Like for instance ... save to this computer to a folder named Pictures, and for that particular record create a subfolder which will be called like the process number or customer name. Is this possible?
Thanks

  #8  
Unread 20th March 2017, 08:25
RoyUK's Avatar
RoyUK RoyUK is offline
Administrator
Solution Centre Professional
MS Office Version: MS Office 2003, 2007, 2010
MS Office Skill Level: Proficient with MS Office
 
Join Date: Nov 2008
Location: Derbyshire, UK
Posts: 2,706
Posts Per Day: 0.87
My Top Tip Count: 4
Thanks to others: 2
Thanked 195 Times in 193 Posts
Reputation: 3320 (69) RoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond repute
4 Top Tips
England
Default Re: Manage Photos (add,edit,delete..) through userform

------ Register to get rid of these "In Post" ads! ------


The code is in the example. Create your folders and put the link into the table, then run the userform
__________________
Hope that helps, RoyUK
For tips & examples visit free excel help
DatabaseForm
About me

  #9  
Unread 21st March 2017, 11:48
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.34
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Manage Photos (add,edit,delete..) through userform

------ Register to get rid of these "In Post" ads! ------


Hi Roy
Is just the other way arround, meanning ...
I Upload diferent images from diferent folders (computer, cloud ...) to the userform, and when I save or add a new record, the code will send those pictures to a folder named "WhateverYouWant" and inside this folder the code creates a subfolder named "112233" (Process number) or "Mary Goldman" (customer name) that correspondes to that record and stores the images in that subfolder. Is this possible?
Thanks

The Code Cage Advertisment
Advertisement
  #10  
Unread 21st March 2017, 18:49
RoyUK's Avatar
RoyUK RoyUK is offline
Administrator
Solution Centre Professional
MS Office Version: MS Office 2003, 2007, 2010
MS Office Skill Level: Proficient with MS Office
 
Join Date: Nov 2008
Location: Derbyshire, UK
Posts: 2,706
Posts Per Day: 0.87
My Top Tip Count: 4
Thanks to others: 2
Thanked 195 Times in 193 Posts
Reputation: 3320 (69) RoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond reputeRoyUK has a reputation beyond repute
4 Top Tips
England
Default Re: Manage Photos (add,edit,delete..) through userform

------ Register to get rid of these "In Post" ads! ------


You aren't actually uploading the pictures to the form. You can use code to change the directory on the computer if that's what you mean
__________________
Hope that helps, RoyUK
For tips & examples visit free excel help
DatabaseForm
About me

The Code Cage Advertisment
Advertisement
New Reply
The Code Cage at Facebookhe Code Cage at Twitter


Tags
add, delete, edit, manage, photos, userform

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

The Code Cage Affilliates



http://www.thecodecage.com/forumz tested by McAfee Security http://www.thecodecage.com/forumz tested by McAfee Security

All times are GMT +1. The time now is 18:05.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Template-Modifications by TMS
No part of this board, functionality or creatives may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
Copyright ©2008 - , Simon lloyd.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application they represent and are used with permission from Microsoft
UA-8135493-1
Cultural Forum | Study at Malaysian University