Is the versions 12 vs 14 Object Library causing Excel VBA “Code execution has been halted”? - vba

I have an Excel 2007 running the 12 Object Library. The macros run fine when opening the workbook in Excel 2007. However, there is a “Code execution has been halted” message whenever the macros are run in Excel 2010 (the actual break occurs during a ListObjects.Unlink method). I F8 through the breaks but it keeps stopping at each ListObjects.Unlink.
I checked the references on both versions of VBE. The Excel 2007 runs the Object Library Version 12 and the Excel 2010 runs Version 14. There doesn’t seem to be an issue running any other code. Any ideas of what is happening?
Another post on this site recommended clicking debug and pressing [Ctrl+Break] twice to continue. Is there another work around?
Thanks

Related

Corruption in Excel Workbook in 2016 but OK in 2010

I built an Excel workbook at a customer site, on their hardware, using Excel 2010. The workbook has an ActiveX button to execute macros to run a SQL stored procedure and populate a data sheet. I use the same code at all my customers. The workbook runs fine. I password protect the VBA to stop anyone changing the code.
I took my usual backup copies. When I open the workbook on my laptop, running Excel 2016, I get the
"we found a problem with some content..."
recovery message. If I recover, it removes the button and some of the VBA code.
I have tried amending my Trust Centre settings but no difference. When I VPN into the client, the workbook onsite opens OK. However, another external party has tried opening one of the workbooks using his local 2013 version and gets the same thing.
Apparently, the CFO uses Excel for Mac so I am wondering if this is causing an issue, or whether there is something screwy going on with the versions of Excel. I have created at least 12 workbooks, all using the same code, and they all behave in the same way.
Any suggestions would be greatly appreciated.
after advice from Dave yesterday, it appears that replacing my ActiveX Control with a Form Control has done the trick. I had to amend my macro code slightly as there is no onclick option for a Form button so I created a sub that calls my various VBA chunks which is then assigned to the button.
Thanks for all the responses and advice.

How to get into an Excel Spreadsheet when it's crashing upon opening it due to in-correct VBA code

I'm new to excel and trying to add a VBA Code to create an email distribution list but when I added it, it crashed the spreadsheet and now every time I load the report it's crashing before I can get in and the older version is doing the same, is there a way I can get in and remove the code I added without opening it and crashing it again? Thanks, Allie
Create a new workbook and in it have a macro that simply issues an
Application.EnableEvents=False.
Then open the problem workbook within the same instance of Excel.
Nothing automatic can kill you and you can still debug the VBA.

Excel oleobject cannot delete

I put date picker to my sheet and got a lot of problem
I cant select or delete thoose dtpickers nor manualy nor from VBA as this code
Dim obj As OLEObject
For Each obj In ActiveSheet.OLEObjects
obj.Delete
End If
Next
Return an error
application defined or object-defined error
I using Office 2013 32bit, other computers with Office 2010 32bit, Office 2007 32bit, Office 2013 32bit. I cant run compiled workbook on others computers, as i get in refences missing
microsoft windows common controls 2 6.0 sp6
Which also cannot be removed as is in use. I cannot uncheck it.
Most of my project functions and parameters such (Ucase, Mid, Left, wdAlignParagraphLeft) start getting error as undefined. Also all undeclared variables got the same error. Solving only by writing it with prefix VBA.Ucase, VBA.Mid and etc. and declaring all variables.
Also in developer tab insert control button not active anymore in all computers also in my computer too.
So question is? how to delete thoose dtpickers object and fix my project?
How to know what depend to microsoft windows common controls 2 6.0 sp6 library?
Remove protection from your sheet and then select and delete objects, after that go to VBA editor and uncheck this library from references and restart your Excel application.

One line PPAM add-in causes PowerPoint 2013 to crash

I have a user with a brand new machine with Win 7 x64 SP1 (6.1.7601), downgraded from Win 8, on it plus Office 365 Small Business Premium with PowerPoint 2013 32 bit (15.0.4649.1000).
I am debugging a PPAM add-in and have narrowed it down to a very bizarre situation I've never seen before:
Create a new PowerPoint file
Open the VBE, insert a module and add a one line sub as below
Save it as a PPAM
Load the PPAM add-in and see the message
Close PowerPoint
Open PowerPoint and it crashes with the message "Microsoft PowerPoint has stopped working" and the sub-text "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."
I kill PowerPoint and when running again am asked the usual question if I want to disable the "offending" add-in
What on earth can cause such behaviour? No other PPAM add-ins are running and I have tried with all COM add-ins disabled and with running powerpnt /safe
My one line test sub inside the PPAM:
Sub Auto_Open()
MsgBox "It works"
End Sub
Btw, the full (and very complex) add-in works perfectly when loaded in its source PPTM form.
Badly written COM add-ins can cause this kind of thing, where PPT crashes at shutdown or startup and points the Fickle Finger of Blame at whatever PPA/PPAM add-in is closest at the time.
I'd have them disable any COM add-ins other than the MS-supplied ones, which I've never run into any troubles with, then try again.
The "Win7 downgraded from Win8" bit makes me nervous too, but I can't toss any experientialia at you about it.
I guess you already asked if they have Kaspersky?
Do they have any other ppa / ppam add ins (maybe hidden one from HKLM

Listview on worksheet generates cannot insert object error Excel 2010

Hi I have an Excel 2003 application which has a listview embedded in the worksheet. It no longer works on Excel 2010.
I re-registered the ocx using regsvr32 C:\Windows\System32\MSCOMCTL.OCX as per advice.
This works for listviews on forms, but not for the worksheet.
Microsoft advises that Cannot insert object can be generated if the control is form specific and an attempt is made to add to the worksheet.
Can the listview be used in Excel 2010 on a worksheet
If so how?
Otherwise a rewrite will be required.
That happened to my Excel files using ActiveX or any sort of automation. The solution was confused at the beginning but the following link will help you.
Create a batch to remove cached control type libraries (extender files *.EXD) files from Windows
Opening each of the projects (Excel with macros)
Switch the file to design mode
Open VBA Code (Alt-F11) to edit any module and press from the main menu > Debug > Compile VBAProject
Switch back to Run Mode
Save and Close File
Reopen the file & test
Form Controls stop working after December 2014 Updates