Automation Error Library Not Registered

Hello.  I have Office 2010 and am trying to open an excel file in vba.  I get the attached error.  Can someone help me with resolving it.

Private Sub cmdOpen_Click()

    Dim xlApp As Excel.Application
    Set xlApp = CreateObject("Excel.Application")

    xlApp.Visible = True


ERROR:
Automation error
Library not registered
    xlApp.Workbooks.Open "E:\DEVHELP\A\Abstract Reporting-Done\test\Template CoreAbsSum0915.xlsx", True, False
    Debug.Print xlApp.Version
    Set xlApp = Nothing
    xlApp.Quit


End Sub
Automation-Error_LibraryNotRegistere.doc
ilfocorpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Karrtik IyerSoftware ArchitectCommented:
Instead can you try doing below in open click?
Workbooks.Open ("sales.xls")
After work is done
Workbooks("sales.xls").Close
http://www.excel-easy.com/vba/examples/close-open.html
ilfocorpAuthor Commented:
Sorry guys.  I put the error in the middle of my script.  see  updated question below;

Hello.  I have Office 2010 and am trying to open an excel file in vba.  I get the attached error.  Can someone help me with resolving it.

 Private Sub cmdOpen_Click()

     Dim xlApp As Excel.Application
     Set xlApp = CreateObject("Excel.Application")

     xlApp.Visible = True
     xlApp.Workbooks.Open "E:\DEVHELP\A\Abstract Reporting-Done\test\Template CoreAbsSum0915.xlsx", True, False
     Debug.Print xlApp.Version
     Set xlApp = Nothing
     xlApp.Quit


 End Sub

ERROR:
 Automation error
 Library not registered
ilfocorpAuthor Commented:
Thanks Karrtik, but I am trying to open the excel file from Access 2010 vba.
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Wayne Taylor (webtubbs)Commented:
Take a look at this, which requires registry edits.

Also, instead of this...

      Dim xlApp As Excel.Application
      Set xlApp = CreateObject("Excel.Application")

...try just this, which does the same thing...

     Dim xlApp As New Excel.Application

Wayne

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Karrtik IyerSoftware ArchitectCommented:
Ok,
In your code we are trying to use COM  to open excel files. This error indicates that the COM interface we are trying create using create object is not found in the registry. This registry entries are created when the excel COM interop DLLs register themselves during installation, they can also be manually registered if we know the dll name. Try the solution that Wayne has suggested and get back to us if you still face some issues.
There is a good question on EE on the best way to do this in access using VBA, please see link below.
http://googleweblight.com/?lite_url=http://www.experts-exchange.com/questions/28380710/Opening-and-Closing-Excel-from-Access-in-VBA.html&ei=F3LQLF2E&lc=en-IN&s=1&m=497&ts=1449806112&sig=ALL1Aj739R3JnG_8z9yvjX0qIUVW78Nkkw
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You're also mixing your bindings :)

If you're going to use Late Binding, then do this:

Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")

Many people use Early Binding during development, so you can have Intellisense, but then switch over to Late Binding on deployment to avoid issues like you describe.
ilfocorpAuthor Commented:
Excellent.  Thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.