I have an Excel 2010 xlsm file that is going to open another workbook and work with data from it. Currently the other file I have been playing with is an xlsx. My code looks like this:
Dim strDataFile As String
strDataFile = OpenFile()
Function OpenFile() As String
Dim wb As Workbook
Dim Name2 As String
ChDir "\_ Log Merch Optimizing\Rich Frazer RTL solutions"
strFileName = Application.GetOpenFilename("Excel 2010 Files (*.xlsx),*.xlsx")
If strFileName = "False" Then
Set wb = Workbooks.Open(Filename:=strFileName)
OpenFile = ActiveWorkbook.Name
However as soon as the Workbooks.Open occurs, the other workbook opens, but my code stops executing. I've opened other workbooks with VBA in several projects and I don't remember this happening before (if it did it was when I was working with Excel 97 and I have no hope of remembering back that far).
Any insight Experts?