Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-16-2018, 03:33 AM
Ivylodge Ivylodge is offline Error message even when picture folder is open Windows 7 32bit Error message even when picture folder is open Office 2007
Novice
Error message even when picture folder is open
 
Join Date: Aug 2017
Posts: 11
Ivylodge is on a distinguished road
Default Error message even when picture folder is open

Hi,


Could you assist as to why i get a run time error message 104,unable to get the insert property of the pictures class.

I enter a part number & then leave the cell.
I see the msgbox.
I click on Yes.
Now i see the error message BUT also the picture folder opens.
I close the picture folder and now the error message is shown on the screen.

I dont need to see this error message as i selected Yes to open the picture folder.

Please can you advise how i stop this message showing.
Thanks very much


Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim shp As Shape
If Intersect(Target, [A:A]) Is Nothing Then Exit Sub
If Target.Row Mod 20 = 0 Then Exit Sub
On Error GoTo son

For Each shp In ActiveSheet.Shapes
If shp.Type = msoPicture And shp.TopLeftCell.Address = Target.Offset(0, 1).Address Then shp.Delete
Next

If Target.Value <> "" And Dir("C:\Users\Ian\Desktop\SKYPE\LOCK PICK ME\" & Target.Value & ".jpg") = "" Then 'picture not there!
    If MsgBox("Photo " & Target.Value & " Doesn't exist" & vbCrLf & "Open The Picture Folder ?", vbCritical + vbYesNo, "No Photo Found") = vbYes Then
        CreateObject("Shell.Application").Open ("C:\Users\Ian\Desktop\SKYPE\LOCK PICK ME\")
        Else
        Exit Sub
    End If
End If
ActiveSheet.Pictures.Insert("C:\Users\Ian\Desktop\SKYPE\LOCK PICK ME\" & "\" & Target.Value & ".jpg").Select
Selection.Top = Target.Offset(0, 1).Top + 5
Selection.Left = Target.Offset(0, 1).Left + 5

With Selection.ShapeRange
.LockAspectRatio = msoFalse
.Height = Target.Offset(0, 1).Height - 10
.Width = Target.Offset(0, 1).Width - 10
End With
Target.Offset(1, 0).Select
son:

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing userform in document open results in error message LimpingBuf Word VBA 3 07-13-2018 06:42 PM
Error message even when picture folder is open Error Message Received When Attempting to Open Doc in WORD or Publisher k5jim Word 1 01-25-2016 03:17 PM
Problem opening Outlook Today. Error Message: Cannot display the folder. Cannot find this file. Veri atwnsw Outlook 0 11-01-2015 05:05 PM
Error message when trying to open excel file Glenda Excel 1 08-03-2015 07:12 AM
Error message even when picture folder is open Automation error Unknown error" message once they open the Excel file hlina Excel 1 10-08-2013 09:14 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft