hi
I do not know what's wrong with my code
hi
I do not know what's wrong with my code
I don't understand your goal, but your code works well, check path and filename
see http://www.vbaexpress.com/forum/faq....thelp_faq_item about the title
Last edited by patel; 07-19-2014 at 08:34 AM.
my friend
thanks for the answer
but the path and filename arr correct
please leve the sample
thank you
I tested your file, I changed path according to my drive, it works
Where are you from my friend
This error message indicates
"file not found"
However, the existing file is
try removing space after pic, with this line
instead ofLabel1.Picture = LoadPicture("C:\Users\Fcc\Desktop\pic" & Cells(1, 1) & ".jpg")
Label1.Picture = LoadPicture("C:\Users\Fcc\Desktop\pic " & Cells(1, 1) & ".jpg")
Hi, shahabsoltan,
I wonder why you use a Worksheet_Event like changing the cells on a worksheet to load a static picture (I would expect you to use either Workbook_Open in ThisWorkbook or Worksheet_Activate behind the sheet instead).
You should consider to describe what you want by using the code (load a picture sure but will that always just be one picture, always the same, should you care for different pictures, do you want a dialog to choose from).
Like stated I think you use the wrong event to get the picture loaded but you may avoid the switch to the VBE by using
This should display the Message Box permanently on each change of cell and ask for a check of Folder and File.Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim strPic As String Const cstrPATH As String = "C:\Users\Fcc\Desktop\" strPic = cstrPATH & "pic " & Cells(1, 1) & ".jpg" If Len(Dir(strPic)) > 0 Then Label1.Picture = LoadPicture(strPic) Else MsgBox "Please check Folder and Name for " & strPic End If End Sub
Ciao,
Holger
hi my friends
thank you for answer
but do not be
please leve the sample
Hi, shahabsoltan,
sorry but what does it mean you posted, esp
Please be reminded that you will need to tell us what you want to achieve (in simple words).but do not be
Ciao,
Holger
sorry, hahobe
please translate use (Persian to English)
هرکاری میکنم نمیشود
Hi, shahabsoltan,
google translation doesnīt make much sense to me either ("Everything I Can not (Be)"). We are looking forward to help you but for doing so we would need information about what you want to do, why you use this event, if you want any other picture inserted into the frame or just the one from this cell, if the name within the cell would change, if any other pictures all would be in the same folder etc.
Ciao,
Holger
I'm using this method for each selected photo
So I seriously need this formula
But whatever I try not to be
I'm hoping to transfer data
Thank you for your attention
happy germa soccer championship
happy german soccer championship
Hi, shahabsoltan,
I still donīt know what you want and what isnīt working on your system and why.
Why do you use the Worksheet_SElectionChange event to load the picture? There is only one number available.
Will there be oine folder with all other pictures as well?
Where will the other cells for the pictures be located on the sheet?
CIao,
Holger