Hello All,
FYI: Using EXCEL 2010
I am still learning VBA so I am still not 100% on exactly where I might be going wrong with this so I am hoping it is a simple fix??? I am looking to attach objects into an EXCEL worksheet and I have gotten as far as the following: (It is connected to a command button)
My current issues are:![]()
Private Sub CommandButton1_click() Dim vFile As Variant vFile = Application.GetOpenFilename("All Files,*.*", Title:=" Find file to insert") If LCase(vFile) = "false" Then Exit Sub ActiveSheet.OLEObjects.Add(Filename:=vFile, Link:=False, DisplayAsIcon:=True, IconFilename:=vFile, IconIndex:=0, IconLabel:=vFile).Select End Sub
1. The code works fine HOWEVER the OLE icon image is missing - what am I doing wrong?
2. The code will attach multiple files of any type HOWEVER the objects are sat on top of each other - what can I do to determine a 'target' for each object (MAX 3 per section needed)
As I said I am a novice so apologies if this is a simple fix but we all have to start somewhere - I look forward to your replies!
Bookmarks