Prevent Pop Up message by opening Excel - excel

Task scheduler opens an Excel application. Sometimes appears at starting the excel instance a window in saying "The last time you opened " ...name of the file...", it caused a serious error. Do you still want to open it?" I need to click on YES manually. After that excel runs normally. I found this has to deal with the registry in this link: https://www.utteraccess.com/forum/index.php?showtopic=2045211.
How to "clear" or change the registry before launching Excel to prevent an appearing the pop-up window? (vbs, cmd)Thanks

Related

What causes this popup in Excel VBA?

I am making a simple tool for my job. It involves opening a file dialog box, selecting a file, opening it, analyzing it for different items, then creating a new workbook with the results. This is all done with VBA macros, activated via a command button.
The code works fine, all does what it's supposed to. However, at the start when the file dialog box is first opened, sometimes this error message pops up:
It doesn't affect the code or how it runs whatsoever, but it is a bit of a nuisance. There is no further detail provided for this "error". Does anyone know what might cause this popup?

VBA Workbooks stop working with upgrade to Excel 365 - VBA Compiling Issue?

Since upgrading to Excel 365, my company has been having all sorts of trouble with VBA-supported Excel workbooks crashing or not functioning properly. The issues have popped up in various workbooks and various departments, including seemingly simple VBA workbooks. I've discovered a fix (see below) but it's not sustainable.
The Issues
The various issues we have experienced are listed below. Note, these issues only occur when you open a file in Excel 365 desktop. The same files, when opened in the Excel 365 browser app or in Excel 2016 will work fine. Also, all these issues happen at random. A user may have been working in a file for weeks and then the next time they open the file they get one of these errors.
"Can't find project or library" errors even when we are using the standard set of libraries and basic VBA. Then when you open the VBA Editor window, all the VBA screens are essentially frozen up and the library list is inaccessible.
Excel hard crashes or locks up when opening these files and enabling VBA. Note, the crash only occurs when the VBA is enabled. If you open a file without enabling VBA, it will work fine (though obviously you can't use any of the code).
The file opens seemingly fine, but the VBA doesn't work and once again, everything is locked up when you access the VBA editor window.
"unhandled win32 exception occurred" error
when executing a command, getting an error 32809 which seems to indicate the compiled VBA has been corrupted
The Fix
Opening the VBA Editor window, then selecting Debug -> Compile VBAProject seemingly fixes the issue. I've yet to experience any of the above issues where the file had been manually compiled this way. The problem with this is that every time you add code to a file or any time you add a new tab to a file, you have to go in and perform this manual compile again.
Yes, apparently adding a single tab in a file changes the workbook structure enough that it is necessary to compile again. The Compiled VBAProject selection will be greyed out. But adding a tab (or adding new VBA) will un-grey it and require another manual compile or the problems start occurring again.
This fix also works to repair files where the above issues are occurring. To fix those files, you can:
Make sure "Disable Trusted Documents" and "Disable VBA macros with notification" are toggled on in your security settings so that VBA doesn't automatically run when you open a file.
Open the file with the errors but do not enable the VBA.
Go to the VBA Editor window, select Debug -> Compile VBAProject.
Save the file, close it, reopen it, enable the VBA, and everything works fine again.
But again, this isn't sustainable because all my users will have to remember to go compile VBA any time they add a new tab to a workbook.
Help?
Has anyone found a more sustainable fix to this issue? Is there a bug with the Excel 365 Desktop automatic compiler that Microsoft is working on?
I think I perhaps found an answer in this thread:
https://social.msdn.microsoft.com/Forums/en-US/814ac2ce-ab45-45dc-8c6a-8ef0775d189a/excel-64bit-crashes-when-activating-macros-but-excel-32bit-does-not?forum=exceldev&prof=required
Per that thread – “the cause is that Excel does not correctly save the compile state of the VBA code and 64 bit Excel cannot recover from that issue when opening the afflicted Excel file (32 bit usually can). A fix was released for only Excel 2016 and not for other versions". That would indeed confirm that it is a bug within Excel and explains why we only see the issue with 365 64 bit Excel.
That also explains why my manual compile fix works. Based on the article I found, there is a more sustainable fix. You can change Excel’s registry and force VBA to compile accurately.
To implement the permanent fix:
Open the start menu and type “reg” and select the “Registry Editor”
Navigate to: Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\options
On the Edit menu, point to New, and then click DWORD Value.
Type ForceVBALoadFromSource, and then press Enter.
In the Details pane, right-click ForceVBALoadFromSource, and then click Modify.
In the Value data box, type 1, and then click OK.

Excel crashes when pressing "developer tools" button

I have the following problem in Excel:
I wasdevelopping a template in Excel VBA. I was tearing a sub routine in break mode and tried to stop it to change the code. When I pressed the stop button, however, Excel froze so I had to kill the process. Although before the crash everything was ok, opening the file would cause excel to freeze and crash again. Obviously the file got corrupt. I used a previous version of the file and decided to redo the changes. At some point the problem happened again. When I finally managed to open the file, everything seemed ok, but pressing the "developer tools" button on the ribbon crashes excel. I desperate. The Template is 90% but making even the slightest change feels like disarming a mine bomb that can blow the template up.
Does anyone know how to bypass the problem?
Here is what I would suggest:
get another PC with the same version of Excel installed,
Install the VBA CodeClener Add-in (http://www.appspro.com/Utilities/CodeCleaner.htm),
Copy your (prior) spreadsheet over to that PC, open it, open developer tools and run CodeCleaner.
Add your changes.
If that works, then reinstall Excel on your first PC. If not then you will have to take drastic measures:
Open the prior version,
Make one (or a few) change at a time,
After each small set of changes, save a new version of your Excel file, adding a version number to the file name (update the version/file name each time)
If it fails again, go back to the previous version, and the try to figure out which of the small set of changes may have corrupted the file.

How do I make an Office 2013/2016 application run in separate process on Microsoft Windows?

I am developing a Excel plugin. It works all right for Excel versions before 2013. But a lot of features is broken when it runs against Excel 2013. I found the root cause is all windows are running in only one process in Excel 2013. Even if user explicitly launch a new window by double-clicking the shortcut on the desktop or by clicking the item in the start menu, no new process is created.
This results in the status conflict between processes. Status bar and ribbon is shared. For instance, when I update the status bar information in one window, the other windows' are also updated. When I check/uncheck a ribbon button in one window, the other windows' buttons are also checked/unchecked.
I think a possible solution is to change some configurations to make it work as before. But I found nothing relevant by searching on google.
Does anyone know how to make it or is there any other solution?
With Excel 2013, the default you have is to create a new window within the existing Excel process. In order to force the creation of a separate instance of the Excel process, you have these options:
Option 1
From the command prompt, run EXCEL /X and you will open Excel window as a new instance. The /X command switch forces the creation of a new instance.
Option 2
Right click on the Excel icon in Windows taskbar
Go down to where it lists the application
Hold down the ALT key on the keyboard and click "Excel 2013/2016"
It should give you this prompt, "Do you want to start a new instance of Excel?"
Click "Yes!"
Option 3
Use this technique to open an existing document directly:
Hold down Alt.
Right click Excel file.
Click Open.
Continue holding down Alt until the "Do you want to start a new instance of Excel" dialogue pops up.
Click Yes.
For more detail,please visit:
http://sqlblog.com/blogs/marco_russo/archive/2012/07/24/running-excel-2013-in-a-separate-instance-excel-powerpivot.aspx
re. "Right click on the Excel Tab in Windows taskbar keeping the ALT key pressed"
-This option is not available in Windows 10 with Excel 2016.
However, the Excel /X option works and a second change-undo buffer is created, as noted above, in the new process.

Excel 2007 automatically starts debugger when showing dialog

I have a UserForm and when I display it dlg.Show vbModal excel is entering the debugger. There's no error, it just enters the debugger - like it thinks it has hung. How do I stop it from enter the debugger?
Moving my comment to an answer so that this question doesn't get DELETED automatically.
Reason Why this happens:
For some reason, the VBA project thinks a breakpoint existed within that event script, so the VBA editor stops on that particular line of code, although there is no visible breakpoint seen.
Two ways to solve this problem:
As per THIS MSDN ARTICLE, select the Clear All Breakpoints option under the Debug menu.
If the above doesn't work, then simply re-start your pc. Remember to save your work if applicable.

Resources