Word VBA Can't Exit Design Mode Error (Word 2003) - vba

I have a Word form that has a bunch of command buttons, form fields, and combo boxes. There is a lot of code associated with the form both in the "ThisDocument" object and another module I added.
If I open the form by double-clicking the document from Windows, it opens and works fine when I enable macros.
However, if I open Word first, and then go to File > Open to open the form, I get an error message "Can't Exit Design Mode because Control cmdInstructions can not be created.
I've seen this error on a few other users' computers also, and it sometimes refers to different controls, not just the cmdInstructions button.
This problem began when we upgraded to Word 2003. Again, if you double-click on the document in Windows to open it, there is no problem. The message only crops up when you have Word already open (with a blank new document).
Has anyone seen this problem before? What do I need to do to my code to avoid this problem?

It may be late, but the answer is to upgrade to Office 2003 Service Pack 3

Related

VBA Word. Open document problem when i re-open the sam document

some years ago i writed a VBA macro that handle the Word events (as the open document), and after some operation it close the word document and quit. My customers used the macro correctly until the last update of Word. The problem is if I try to re-open the document, Word give me the message that the docuemnt had a crash error and ask if i want to repair it. I had view that the document, after i quit Word application, is in the list of the disactivated elements. If i search in the application log of Win I can't find crash of Word. There is a way for know the reason of this behavior?
disabled elements
re-open document
I checked that the macro does not go into error. I put messages up to Auto_exit and the macro runs fine.

Open Relink dialog via button

I am new to MS Access 2016 and came across a supposedly minor issue but I couldn't figure it out yet.
I'd like to use a button on a form which opens the dialog "Relink Lists to New Site". The relinking will be done manually but opening it should happen by a button-click.
The manual way to open it would be:
right-click on any table
More Options
Relink Lists...
I thought of some vba code or a macro to connect to the button.
Does anyone know if this is actually possible and if yes, any hints?
I'd appreciate any hints.
Since this button can also be found in the ribbon, you can use the idMso to invoke it:
Application.CommandBars.ExecuteMso "AccessRelinkLists"
You can find a listing of all idMso identifiers used in Office 2016 here: https://www.microsoft.com/en-us/download/details.aspx?id=50745. This contains an Excel file for each Office program with a listing of all possible controls and their identifiers.
Note that this button is context-dependent, and if you invoke it in a context where it's unavailable (e.g. an Access database without SharePoint lists) it will error.

VBA Password Prompt shows on Exit from Excel

I have been experiencing an issue where the VBA Password Prompt appears when exiting Excel for workbooks that have a locked VBA project.
For me it is happening on a Win10 / Excel2013 and Win10 / Excel2016 environment. I have searched for and tried a number of possible solutions. See the attached workbook and a step recorder that shows this happening for one of the tests. One interesting difference for the tests that are included to the workbook is in the case where a "pop-up" form is displayed, when closing the VBA password prompt is shown 5 times instead of 3 times on a standard exit from the workbook for the other tests.
Sample Workbook - https://sites.google.com/a/xlautomation.com.au/website/free-downloads/TestVBAPassword%20v2%20Share.xlsm?attredirects=0&d=1
Password to see the code in this workbook...."password"
Step Recorder showing the issue - https://sites.google.com/a/xlautomation.com.au/website/free-downloads/VBA%20Password%20Prompt%20Example.zip?attredirects=0&d=1
I can see from other posts that this problem has appeared over the years and some have resolved it with removing Add-In references, Closing Excel in a certain way none of these are working in my case. It is not a viable option to unprotect the VBA project as the workbooks are shared with others and allowing access to the code would present support issues.
If anyone has further suggestions to resolve this issue please share those back.
I have also include a demo of the issue in action below...
Could it be you have Dropbox installed on your system. A weird pointer to it solved my solution (short of making the Excel sheet into an xlam add-in) in no longer asking for the password:
right click on Dropbox symbol in system tray
Select the gear symbol (settings) at the right top
Select "Preferences"
In its "General"tab set "Show Dropbox Badge" to "Never show".
Click OK
That's it. How that affects Excel I don't know.

Excel giving "System Error &H80004005 (-2147467259). Unspecified error" message

Everytime I load up my Excel document, it repeatedly shows up with the message from the title. The two options are OK and Help. help opens Office Help which is useless for anything. Clicking OK displays another message saying "Compile error: Out of memory." with OK and Help buttons. Clicking OK brings up VBEditor with no debug line selected and no macro popped up either for that matter. Eventually, after it repeats that and complains 20 (exaggeration) more times (I think that's due to having a lot of duplicate code for ActiveX controls on each sheet). It highlights the first line (the Sub declaration) of the code below.
Private Sub ComboBox4_Change()
Range("B3") = ActiveSheet.ComboBox4.text
End Sub
Now this is dealing with an ActiveX ComboBox. Opening a file from an earlier date will give no errors. It's like after a certain date, it just refuses to work with it. And get this, it's only happening on one computer. The files are saved on a network drive, which shouldn't be causing an error.
I'm almost 100% certain I found a solution to this issue. It may have caused issues for someone else 4 years ago, but it caused issues for me today and I wanted to contribute my answer for anyone else running into the same problem.
I had enabled an "Additional Control" in the Controls Toolbox for Windows Media Player. I think when it loaded in a video file, it overran the memory. This is when I started panicking (company computer and all) and Googling and came across this and a few other articles without a real, fast fix.
The hunch: Once that video file was attempted to be loaded in RAM memory (because that's how Userforms work) it locked up all the memory Excel would allow before throwing all the errors.
What I tried from other posts in various places: I rebooted a few times (before Googling, even). I tried the Quick Repair of Office from Add/Remove programs, that didn't work. (I'm using Office 2016.)
So, what worked? I had the idea that maybe I could disable all ActiveX from loading in my file, and Googled that. I got: https://support.office.com/en-us/article/enable-or-disable-activex-settings-in-office-files-f1303e08-a3f8-41c5-a17e-b0b8898743ed and proceeded to disable all ActiveX controls in Excel. I closed the file out. Can't recall if I closed Excel but I probably did.
Then I loaded up my file. (ActiveX is totally disabled at this time.) No errors! I went to VBA (ALT + F11), opened my UserForm, and the video I had inserted and could not remove was just... gone. I saved the file. I closed the file.
I opened Excel. I re-enabled ActiveX in the Trust Center. I opened my file. Still, no more video on my UserForm (I didn't need it anyway) and no "Unspecified" (memory) errors! And, I can save again!
I hope this solution persists... if not I've got some "splainin' " to do. So far, I'm designing and using the Userform, and saving the file, with no issues whatsoever. I think it worked!
I believe the problem was that I had a user form with an acrobat reader display control (like an iframe, but for PDFs). I didn't have this reference or control on that specific computer and it freaked out. Not 100% sure, but the problem no longer exists.
I have been having a very similar problem with WindowsMediaPlayer (WMP) ActiveX control that I have in a Form. Some computers with office 2016 are giving this error code (usless the help button), this is the first post I have found about something similar with WMP, and I found it after searching for this error on ActiveX controls...
So my solution was to go to VBA (alt+F11), right clic on form that has the activex control and then remove it witohout exporting.
The big problem is, that for me, this form is the most important part of the application.
I have no mor information, if I find something I'll come back to post feedback.
I encountered this issue when trying to pull data from an access database. The query I was trying to pull from in the database was an all value query (*). Once I added the individual fields, the error went away.
I've got this error, when I create a user form which has no body section(just header). (Using this method for the messages where I don't expect a user response. Like a progress bar.
Probably, any abnormality(*)or inconsistency with the user form causes this problem.
Solution: Changed the height of the user form just a few pixel.
Just a simple trick worked for me
Go to Excel Options
Manage Excel Add-ins
Uncheck all and click ok

No Add-In Tab Though Add-In is Loaded and Working

I wrote an Excel VBA add-in over ten years ago, which uses the old Commandbars to put a menu in Excel's Tools menu (in Excel 2003 and earlier) or in Excel's Add-Ins tab (in Excel 2007 and later). I've never had a problem with the menu appearing, in all versions of Excel from 97 through 2013.
But now a user says Excel Add-Ins menu not appearing for him in Excel 2013. Normally that means the add-in isn't loaded, but in his case the add-in is loaded and working. We know the add-in is loaded and working because the add-in adds user-defined worksheet functions, and those UDFs are working fine for him. But he wants to get to the add-in's menu and can't.
My googling showed that some people are having trouble with the Add-Ins menu in 2013, but I didn't find anything specific to this problem.
Yes, he's tried enabling the Add-Ins tab in Excel Options > Customize the Ribbon.
BTW this is an .xla add-in, not a COM add-in.
Any suggestions?
I have Excel 2010 and had the add-in tab disappear for MrExcel HTML add-in. I tried all types of suggestions - and finally found one that worked for me!
Go to the add-ins folder where you have your add in saved. Right click on the file, and select Properties. At the bottom of the General tab - if it says "Security" - check on the "Unblock" option.
Voila! My add-ins never disappear anymore!
Solved:
Solved this now but really weird solution if you enabled the Add-in whilst the Analysis ToolPaks were enabled it'd have the issue you above, but if you enabled the Add-in whilst the Analysis ToolPaks weren't ticked then went back in to it and re-ticked the Analysis ToolPaks it'd be fine and wouldn't disappear!
Was an extremely strange issue!
See Spiceworks
As far as I understood this is a problem with Excel 2013 (another attempt of the guys at Redmond to make our lives miserable with every update of their products). The workaround I've found is to include the following code into the ThisWorkbook module of the Addin:
Private Sub Workbook_Open()
Workbook_AddinUninstall
Workbook_AddinInstall
End Sub
Cheers!
I had similar issue with excel 2013. Add-in tab was missing. I went to Developer>>>Add-Ins and deselected the add-in I wanted. Click OK then repeat the process and select the same add-in. Click OK. The Add-In tab should appear.
See also https://www.excelcampus.com/vba/add-in-ribbon-disappears/
As of july 2016 the security settings in Excel disable the add-ins in the old default location. THe website shows how to set the directory to trusted status
I had a similar problem where two .xlam files that loaded and appeared in custom ribbon tabs in Excel 2010 didn't show up in the ribbon in Excel 2013 even though they were loading each time a workbook was opened. I tried all sorts of solutions - disabling the Analysis Toolpack, disabling and enabling the .xlam files, making sure the .xlam's attached XML file was up to date (I was thinking an MSO image I had in the XML code was no longer available in Excel 2013), but nothing worked. I eventually tried copying and renaming the .xlam file and enabled it in Excel and, strangely, it appeared in the ribbon.
I have no idea why it needed to be copied and renamed - it's almost like Excel 2013 needed a fresh copy of the .xlam file before it could show up. Very weird!
I've been looking for this answer for a LONG time and the previous code worked, but, for me, only with Workbook_Open() instead of Thisworkbook_Open()
Private Sub Workbook_Open()
Workbook_AddinUninstall
Workbook_AddinInstall
End Sub
Thanks for finding this!
I disabled the add-ins via the Developer tab, and then enabled them via File>Options>Add-Ins>Manage Add-Ins.
Voila!
You can Try by disabling macros with notification. (tried on 2016)
File->options->trust center->macro settings-> tick disable all macros with notification
It worked for me .
If I disabled and enabled, I could get the Add-Ins tab to appear, but every time I opened a document I had to repeat. This seemed to fix it for me:
File > Options > AddIns > Choose "XML Expansion Packs" > Go > Select "Microsoft Action Pane 3" > Attach > Ok
I have had similar problems with Excel 2016 (not with 2010 and 2017), and very strangely it was solved this way :
1) Desactivating the add-in
2) Quitting Excel
3) Activating the add-in
4) Going to File > Close (in French version : Fichier > Fermer)
And when I click "Close" the "Components" menu suddenly appear in Excel 2016 !
Good luck !
Had a similar problem in Excel 2010. Tried all the suggestions above, but to no avail. In the end it turned out that even though it was an .xll add-in, it somehow also was listed as a COM add-in. So going to File > Options > Add-In, then selecting Disabled Items from the list at the bottom of that window and enabling the add-in, worked for me. Now in the list of Active Application Add-ins it shows both the original Excel Add-in, and the unexpected COM add-in without location. Oh, and the tab is back of course. Go figure.