Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-19-2021, 05:02 PM
Downunder Dave Downunder Dave is offline Has Office 365 broken the f8 (Step Into) debug facility ? Windows 7 64bit Has Office 365 broken the f8 (Step Into) debug facility ? Office 2010
Novice
Has Office 365 broken the f8 (Step Into) debug facility ?
 
Join Date: Jul 2021
Location: New Zealand
Posts: 3
Downunder Dave is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 08-11-2021, 06:58 AM
BobBridges's Avatar
BobBridges BobBridges is offline Has Office 365 broken the f8 (Step Into) debug facility ? Windows 7 64bit Has Office 365 broken the f8 (Step Into) debug facility ? Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

For what it's worth, I haven't noticed this behavior in Excel. I have Office Pro Plus 2019 and I do a lot of automation in Excel, a little in Outlook and Access, almost none in Word.

Thinking about a possible explanation, it occurs to me that you may have an event turned on that executes VBA code when you open a workbook....here it is, WorkbookOpen. If that's waiting to execute, then it'll execute when your code opens a workbook, and what happens after that depends on what your WorkbookOpen code does. If this is the case, you can prevent it by turning Application.EnableEvents off before opening the workbook, and restoring it afterward.

One other possibility (and here I'm stretching): Maybe the workbook you're opening has active content itself, and somehow it's getting control?
Reply With Quote
  #3  
Old 08-11-2021, 06:50 PM
Guessed's Avatar
Guessed Guessed is offline Has Office 365 broken the f8 (Step Into) debug facility ? Windows 10 Has Office 365 broken the f8 (Step Into) debug facility ? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I have noticed similar in Word. I just apply a couple of breakpoints when it happens to rein it in and get back to stepping through again.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Step by Step Book Practice Files joebluegolf Project 0 02-07-2018 02:28 PM
Has Office 365 broken the f8 (Step Into) debug facility ? Can I bring contents of slide step-by-step yabi PowerPoint 1 12-17-2011 03:13 AM
Broken office 2010 help lekebjerg Office 0 12-11-2011 10:57 AM
Lost facility gerry Word 1 05-08-2010 09:53 AM
Microsoft Office 2003 winword.exe Debug Error! abnormal prog elo1bev Word 0 12-22-2005 10:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft