PDA

View Full Version : Major problem with Macros -Powerpoint update?



Cosmo
05-07-2012, 03:55 PM
I am having a huge problem right now, all of the PPT programs I have written are no longer running on my or my client's machines, I am guessing due to a recent PowerPoint 2007 update. I get the message "Object Library invalid or contains references to object definitions that could not be found" when I try to run them, and it highlights a function definition (it is highlighting the entire parameter list:

Private Function GetSettingsDialog(ByRef useTemplate As Boolean, _
ByRef pullDataIntoMaster As Boolean, _
Optional ByVal yearQuarterKey As Integer = 0, _
Optional ByVal offsetValue As Integer = 0, _
Optional ByRef fileToClose As PowerPoint.Presentation = Nothing, _
Optional ByVal INONumber As String = "", _
Optional ByVal Version As Integer = 0, _
Optional ByVal Revision As Integer = 0)

The only parameter that is not a simple datatype is PowerPoint.Presentation. If I take that line out, it highlights a different function call and highlights a boolean constant used as a default for that parameter.

Does anyone know if there was a recent update to Office/Powerpoint which is causing problems?

I'll post more if I make any progress in detailing where the issue is, but I'm at the 'tearing my hair out' stage right now.

EDIT - IT doesn't seem to be that function call specifically - if I copy that function call into a blank document, it causes no errors.

Is there any way to determine which library might be the cause of the issue?

Cosmo
05-07-2012, 04:27 PM
I checked on my other PC, and the files run properly, it looks like it is the update - that machine has version:
12.0.6548.5000 SP2 MSO (12.0.6545.5004)

The trouble machine has version
12.0.6654.5000 SP3 MSO (12.0.6607.1000)

I can't tell our clients to remove the update, I need to find a way to fix this issue, but I am helpless - I tried changing the variable in the parameter from 'PowerPoint.Presentation' to 'Variant', and it no longer highlighted that section, but continued with errors everywhere else.


:po: I am so frustrated right now

Cosmo
05-07-2012, 06:06 PM
Ok, I traced the problem to a Progressbar control I am using on 2 of the userforms. I removed it along with commenting out the lines which reference it, and now everything works properly.

Not sure why that control is no longer working, I'll have to look into it further once I calm down a little, and have the time to investigate.

Edit - I went to test the progressbar on a blank document, and once I add the control to toolbox ("Microsoft ProgressBar Control, version 6" in the menu), it won't let me drag it onto the form, and I get a 'Element not found' if I try to click and drag to create a new control.

Looks to me like Microsoft *****ed that up, if anyone else can confirm I'd be interested in knowing if it is indeed a bug.

John Wilson
05-08-2012, 04:44 AM
It works here and I have the same version as your troublesome Pc

12.0.6654.5000 SP3 MSO (12.0.6607.1000)

If you select it in Additional controls does it show the ocx location?

It is usually at C:\Windows\system32\MSCOMCTL.OCX

Cosmo
05-08-2012, 05:09 AM
It works here and I have the same version as your troublesome Pc

12.0.6654.5000 SP3 MSO (12.0.6607.1000)

If you select it in Additional controls does it show the ocx location?

It is usually at C:\Windows\system32\MSCOMCTL.OCX
That's odd, it doesn't work on any of the computers I have tried that have the update, and since our client encountered the issue first, I am assuming that their computers are the same.

The path for the control in my system is slightly different:
C:\Windows\SysWOW64\MSCOMCTL.OCX

What OS are you running? I'm using Windows 7. The PC which doesn't have the issue is running XP, and has the SP2 patch. Is it possible it could be a system update instead of (or in conjunction with) an Office update? Is it only an issue with 64-bit version of Windows?

Cosmo
05-08-2012, 05:39 AM
I just tested on another machine with the same settings (64-bit Windows 7, PPT SP3) and it does run on that machine. The path for the control is the same as on my problem PC (and on that one, there's also a version 5 of the control)

Now I'm stumped as to where to look to determine what is causing the issue.

John Wilson
05-08-2012, 09:05 AM
OK so it doesn't seem to be available on our 64 bit Office on Windows 7. That's not surprising as it's a 32 bit control.

If you have 32 bit Office on 64 bit windows SYSWOW64 is where I would expect it to be.

You might have to re register it with regsvr32

In a run box type REGSVR32 MSCOMCTRL.OCX

You might need

REGSVR32 "C:\WINDOWS\SYSWOW64\MSCOMCTL.OCX"

There's also a thread here (http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/mscomctlocx-dependency-error-attempting-to-install/f96acaa3-90d7-437a-a9cc-9130eb17fdb4) which might shed more light

Cosmo
05-08-2012, 10:12 AM
Thanks for the update, I'll look into that. I don't want to mess up (or fix for that matter) my main machine, so I'll have to wait until I can get access to one of our tech guy's extra machines. I'll also see if he can check with Microsoft to see if they can shed any light on this issue.

I wasn't aware that one of the machines it was having a problem on was running XP, (I don't see a label to say whether it is 32 or 64 bit - was XP available in 64 bit?) so it may not be a 64 bit issue.

For now, the fix is pretty simple - I removed the progressbars from the program (since their functionality doesn't actually affect the program; the user just has to deal with waiting without any indication about the process' progress), but I now have to do that for 3-4 programs that have been distributed to the clients sales force in case the issue occurs with any of them.:mad:

I again thank you for your time, you are always a huge boost to both my work and my sanity.

John Wilson
05-08-2012, 11:20 AM
XP was available in 64 bit but it's not common.