We help IT Professionals succeed at work.
Get Started

Open excel file from powerpoint via vba throws error 32809

149 Views
Last Modified: 2015-03-31
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
Comment
Watch Question
Consultant
Commented:
This problem has been solved!
Unlock 1 Answer and 13 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE