I have a macro which I created about 10 years ago in VBA for Excel for Mac. I and others in my company used this consistently over this time period with no issues. Now I have been having multiple problems since switching to Excel For Mac in Office 365. I use this one particular macro to insert lines saved in another spreadsheet into the spreadsheet I am currently working on. As I said, it worked perfectly for all previous versions on Mac and PC. Now when I run it I get inconsistent results.
The code is written to allow me to use a file open dialogue box to open the spreadsheet file I want to use and insert into my current spreadsheet. I ran the debugger and noticed that the workshops.open command was not always opening the file I had identified. The first time after opening my spreadsheet it runs fine, but then its inconsistent afterwards.
Any Ideas?
Here's the portion of the code that opens the other file. The whole macro is very long, so I am only including this segment here.
- - - - - -
Dim FileToOpen As String
Continue = MsgBox("This will insert a new Task before the Task currently selected. You must now select a Task from the templates saved on your hard drive!.", vbOKCancel)
If Continue = 1 Then
line1:
FileToOpen = Application.GetOpenFilename 'This opens a file open dialogue box and records the file name and location as a string
If Not FileToOpen = "False" Then
GoTo line3:
Else: GoTo lastline:
End If 'End If
line3:
Workbooks.Open (FileToOpen)
lastline:
The code is written to allow me to use a file open dialogue box to open the spreadsheet file I want to use and insert into my current spreadsheet. I ran the debugger and noticed that the workshops.open command was not always opening the file I had identified. The first time after opening my spreadsheet it runs fine, but then its inconsistent afterwards.
Any Ideas?
Here's the portion of the code that opens the other file. The whole macro is very long, so I am only including this segment here.
- - - - - -
Dim FileToOpen As String
Continue = MsgBox("This will insert a new Task before the Task currently selected. You must now select a Task from the templates saved on your hard drive!.", vbOKCancel)
If Continue = 1 Then
line1:
FileToOpen = Application.GetOpenFilename 'This opens a file open dialogue box and records the file name and location as a string
If Not FileToOpen = "False" Then
GoTo line3:
Else: GoTo lastline:
End If 'End If
line3:
Workbooks.Open (FileToOpen)
lastline: