Link to home
Start Free TrialLog in
Avatar of Mik Mak
Mik Mak

asked on

Open excel file from powerpoint via vba throws error 32809

When trying to open an Excel file from Powerpoint via vba, it has started  throwing an error 32809. Its been working fine , and it's only a select Group of machines that gives the error - on other test machines it Works as usual. All machines running  Win7 / Office 2010

Sub OpenFile()
    Dim strxlsFil As String
    Dim objXL As Object
    Dim boolXL As Boolean
    Dim objActiveWkb As Object
   
    strxlsFil = ActivePresentation.Path & "\MyFile.xlsm"
   
    If Dir(strxlsFil) = "" Then
        MsgBox "The indicated Excel file (" & strxlsFil & ") could not be located", vbCritical
        Exit Sub
    End If
       
    Set objXL = CreateObject("Excel.Application")
    objXL.Application.Workbooks.Open strxlsFil
    objXL.Application.screenupdating = False
    Set objActiveWkb = objXL.Application.ActiveWorkbook
    objXL.Visible = True
    objActiveWkb.Worksheets("Order").UnProtect  <- this is where the error is shown
ASKER CERTIFIED SOLUTION
Avatar of Mik Mak
Mik Mak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rory Archibald
Unless you can remove all activex controls from the workbook, there's not much else you can do really if you can't run the fix on all machines and make them all have the same updates.
Given the error is occurring on the first line that performs a write operation on the target Excel file, has the file been opened as read only or in protected mode on the machines that are failing?
Avatar of Mik Mak
Mik Mak

ASKER

No, definately not read-only mode.
try adding your path to trusted locations in excel trust center (file-options-trust center-trust center settings - trusted location
Avatar of Mik Mak

ASKER

Still investigating - will return in a few days with news :)
Avatar of Mik Mak

ASKER

Good point, but it also fails on the next few lines (not shown in my code example), where I'm trying to update a Range
Do a search for extender files (*.exd) and delete any you find. They will be remade.

See if the code now works

http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2014/12/11/forms-controls-stop-working-after-december-2014-updates-.aspx
Avatar of Mik Mak

ASKER

I have already shown that link to the Customers servicedesk - I'm awaiting their response :)
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Avatar of Mik Mak

ASKER

The solution was related to a recent update from Microsoft - I'll accept my own answer/link as the solution
Avatar of Mik Mak

ASKER

The solution was related to a recent update from Microsoft - I'll accept my own answer/link as the solution
Avatar of Mik Mak

ASKER

Applying the Microsoft updates from 10. march solved (as per the link) the issue