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
- 2833 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago