But be aware that with several workbooks open you need to keep track of which is which - so it's also a good idea to assign a variable to ThisWorkbook (the one where the code is). Also, assigning variable is a good practice since it allows you to troubleshoot problems in the code. There's something about doing file input/output lines that causes Excel macros to just run the code rather than stepping after those lines. What this means is that you will step through each line of code in your current procedure as well as step into the code of any procedures that are called by the current procedure. You can choose to 'Step Into' your code in Excel 2016. This allows you to put break points before and after the line which opens the file and that way you can step through the code again. While in debug mode, you can 'Step Into' your VBA code in Excel 2016. I've experienced the problem you have described, and for me the following worked:ġ) rather than Workbooks.Open Filename:= "C:\file2" use variables such as: Dim wk as Workbook, sh as worksheet, path as string Microsoft Pro support have directed me to the Excel fora. This is a frustrating issue preventing effective debugging. *The same issue is described in following link:Įxcel 2013 VBA Workbooks.Open Loses Debug Step Mode?īut the 'ideal' solution is to add a breakpoint after the workbooks.open line.This does not work in Excel 2016 - the routine stops but on the first press of F8 the routine completes to end.īut the solution (requiring changes to the registry) applies to earlier versions of Excel and does not work for Windows 10/Office 2016. You have an Excel VBA Macro that is not working VBA has amazing debugging tools Rather than run your code, you can step through the code using F8 The line in yellow is the line that it about to be run Hover over any variable to see the value of that variable. How to debug vba in excel 2016 64 Bit#I’m running Windows 10 on a 64 bit machine, and a 32 bit version of Office professional Plus 2016 The file opens okay but on return the remainder of the sub just executes to the end (I lose step into mode). Similar to a previous thread*, when I step into a VBA sub in Excel 2016 and then step into the statement:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |