Hello,
I have the below code to extract data from a certain excel file (xlsx type) but I want to include two things in the macro.
1) The macro should directly open a certain folder directory for me to select the file from for example: "C\My Documents\"
2) And two if I press cancel instead of opening the document in the folder directory I want it to stop the macro and not show the debug window.
Macro:
Sub OpenPastCFFData()
'
' OpenPastCFFData Macro
'
Dim strSelectedLDCFile As String
Dim path As String
strSelectedLDCFile = Application.GetOpenFilename(", *.xlsx", , "Select Folder with desired Data Files")
Workbooks.Open Filename:=strSelectedLDCFile
Windows("Template Combination Tool.xlsm").Activate
Sheets("COMBINE DATA BUTTONS").Select
Range("M2").Select
'
End Sub
Any help highly appreciated.
I have the below code to extract data from a certain excel file (xlsx type) but I want to include two things in the macro.
1) The macro should directly open a certain folder directory for me to select the file from for example: "C\My Documents\"
2) And two if I press cancel instead of opening the document in the folder directory I want it to stop the macro and not show the debug window.
Macro:
Sub OpenPastCFFData()
'
' OpenPastCFFData Macro
'
Dim strSelectedLDCFile As String
Dim path As String
strSelectedLDCFile = Application.GetOpenFilename(", *.xlsx", , "Select Folder with desired Data Files")
Workbooks.Open Filename:=strSelectedLDCFile
Windows("Template Combination Tool.xlsm").Activate
Sheets("COMBINE DATA BUTTONS").Select
Range("M2").Select
'
End Sub
Any help highly appreciated.