XLA routines: EE_OpenFileFromCell

EE_OpenFileFromCell is a routine that one would use to add to a button
- select a cell containing a file name, and press the button to open the file in the Excel session
- useful for debugging input files
- works with a file name or full path
Sub EE_OpenFileFromCell(rngFileCell As range) Dim rngCell As range 'http://excelexperts.com/xla-routines-eeOpenFileFromCell for updates on this sub routine For Each rngCell In rngFileCell On Error Resume Next If InStr(rngCell.value, Application.PathSeparator) > 0 Then Application.Workbooks.Open rngCell.value Else Application.Workbooks.Open ThisWorkbook.Path & Application.PathSeparator & rngCell.value End If Err.Clear: On Error GoTo 0: On Error GoTo -1 Next rngCell Set rngCell = Nothing End Sub
»
- Nick's blog
- Login or register to post comments
- 2896 reads
Recent comments
5 years 50 weeks ago
6 years 36 weeks ago
6 years 47 weeks ago
6 years 50 weeks ago
6 years 51 weeks ago
7 years 5 weeks ago
7 years 13 weeks ago
7 years 13 weeks ago
7 years 13 weeks ago
7 years 13 weeks ago