G12Consult
Programmer
Is there a way to grey out the 'Create New' tab on this object dialog window so I only have create from file?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub cmdAttachGroupReport_Click()
On Error GoTo Error_Handler:
Dim lngCount As Long
Dim FPath As String
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Show
' Display paths of each file selected
For lngCount = 1 To .SelectedItems.Count
FPath = .SelectedItems(1)
Next lngCount
'Check if file selected
If LCase(lngCount) = "false" Then Exit Sub
'Application.Goto Sheets("Exit_Reports").Range("B2")
'Insert file
ActiveSheet.OLEObjects.Add Filename:=FPath, Link:=False, DisplayAsIcon:=False
End With
Error_Handler: MsgBox "The system has encountered an error: " & Err.Description
End Sub
ActiveSheet.OLEObjects.Add Filename:=lngCount, Link:=False, DisplayAsIcon:=False
Dim lngCount [highlight #FCE94F]As Long
[/highlight]...
If [red]LCase(lngCount) = "false"[/red] Then Exit Sub
Private Sub cmdAttachGroupReport_Click()
On Error GoTo Error_Handler:
Dim fd As FileDialog
Dim FPath As String
Set fd == Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = False
' Show and check if file selected
If .Show = -1 Then
FPath = .SelectedItems(1)
MsgBox Fpath ' for testing
' Application.Goto Sheets("Exit_Reports").Range("B2")
'Insert file
ActiveSheet.OLEObjects.Add Filename:=FPath, Link:=False, DisplayAsIcon:=False
End If
End With
Error_Handler: MsgBox "The system has encountered an error: " & Err.Description
End Sub