- Code: Select all
Dim sFile As Dialog
Set sFile = Application.Dialogs(xlDialogInsertObject)
sFile.Show , , , True
The dialog box opens on the "Create New" tab, can anyone tell me how I can force it to open on the "Create from File" Tab?
Thanks
This forum has been moved to TeachExcel.com
Ask all future questions in the New Excel Forum.
ExcelKey
Dim sFile As Dialog
Set sFile = Application.Dialogs(xlDialogInsertObject)
sFile.Show , , , True
object_class, file_name, link_logical, display_icon_logical, icon_file, icon_number, icon_label
Dim sFile As Dialog
Set sFile = Application.Dialogs(xlDialogInsertObject)
sFile.Show , True, True, True
Sub OpenInsertObjectDialogUsingConstant()
'Open the dialog box using the xlBuilt-in constant 259.
Dim sFile As Dialog
Dim sFileName As String
sFileName = "C\Documents\"
Set sFile = Application.Dialogs(259)
sFile.Show , sFileName, True, True
End Sub
Sub ED_LOG_AUTO_FILL()
'=================================================================================================================
' ED_LOG_AUTO_FILL is a Macro that determines whether any attachments are going to be used and positions the page
' and cells such that it is ready to insert an Object
'=================================================================================================================
Dim Attachments As String 'Declares variable "Attachments" as a string
Dim BlankLine, Count As Integer 'Declares variables "BlankLine & Count" as Integers
Dim Msg, Style, Title
Dim sFile As Dialog
Msg = "Do you want to add any attachments to this form ?" 'Define message.
Style = vbYesNo 'Define buttons.
Title = "ATTACHMENTS" 'Define title.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then 'User chose Yes.
Range("M41").Select 'Selects Cell M41
ActiveWindow.SmallScroll down:=5 'Scrolls down so that M42 is in view
Set sFile = Application.Dialogs(xlDialogInsertObject)
sFile.Show , , , True
Else
Application.Run ("Auto_Fill")
End If ' User chose No and so carries on sending emails and updating logs.
End Sub
Return to Macros and VBA Questions
Users browsing this forum: Google [Bot] and 240 guests