Has Office 365 broken the f8 (Step Into) debug facility ?
Hi,
I have recently been working with VBA in Excel 365 and Word 365 and so far as I can tell the f8 (Step Into) debug command works fine until the VBA being stepped through executes an OPEN method.
In the demonstration code below, when I use f8 to step through the procedure, everything works just as expected until I have used f8 on the first WorkBooks.Open method. The workbook is opened OK, but from then on the VBA just rips through as though I had used f5 to run the whole thing. It pauses to allow the user to dismiss the MsgBox, but as soon as that is dismissed, it carries on to the end, closing all three workbooks.
This same behaviour appears when using the Documents.Open method in VBA within Word 365.
I feel that this has something to do with Excel 365 and Word 365 opening a separate process for each workbook/document, but I do not think that it should be ignoring the f8 functionality.
Do others see this same behaviour under Excel 365 and if so, what can we do to encourage Microsoft to restore the essential F8 functionality ?
n.b I am not sure why the first workbook name may appear as "My_Excel_Workbo k.xlsx" instead of "My_Excel_Workbook.xlsx", it is definitely properly formed in Edit mode.
Sub OpenMyBooks()
Dim strA As String
Dim strB As String
Dim StrC As String
Dim Rightnow As Date
Dim wbkA As Workbook
Dim wbkB As Workbook
Dim wbkC As Workbook
'Assign some simple variables with their values.
strA = "Apple"
strB = "Banana"
StrC = "Kumquat"
Rightnow = Now()
'Open some workbooks.
Set wbkA = Workbooks.Open(Filename:="C:\Temp\My_Excel_Workboo k.xlsx", ReadOnly:=True)
Set wbkB = Workbooks.Open(Filename:="C:\Temp\TrashMe 2021-04-01A.xlsx", ReadOnly:=True)
Set wbkC = Workbooks.Open(Filename:="C:\Temp\Travel Calculator 2021.xlsx", ReadOnly:=True)
'Tell us where we are......
MsgBox "All Workbooks are now open from C:\Temp"
'Close the workbooks.
wbkA.Close
wbkB.Close
wbkC.Close
End Sub
Cheers,
Downunder Dave
New Zealand
|