Results 1 to 5 of 5
  1. #1
    jcgillies is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    May 2016
    Posts
    4

    New Excel.Application failed

    Hello,

    I am struggling to understand why one of my code is not working. I have attached a screen shot of the problem and the references that I have already. It went from working to not working. I have search all over the net and have seen that the code is correct.


    Click image for larger version. 

Name:	Error.png 
Views:	10 
Size:	85.8 KB 
ID:	25072
    Is there something I am doing wrong? When I click the button it throws that message and highlights "New Excel.Application"

    Many thanks in advance and many thanks to this forum, it has help me get out of a pickle on numerous times.

  2. #2
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    perhaps you need to define ObjXL. ie Dim ObjXL as New Excel.Application

  3. #3
    jcgillies is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    May 2016
    Posts
    4
    Hi,

    many thanks, I tried that it still threw out the error. I cant see why it would throw an error.

    Many thanks alansidman

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    Code:
    Private sub cmd_8_Click()
        Dim objXL as object
        Dim objWkbT as object
    I think you need to declare the objects before you Set them. Try adding these two lines.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    A lot depends on whether you are trying to use early binding or late binding.
    I set a reference to the "Microsoft Excel 15.0 Object Library" when trying to use Excel automation. (but for me, it is "Microsoft Excel 14.0 Object Library" since I have Office 2010)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2016, 10:59 AM
  2. Replies: 1
    Last Post: 08-27-2015, 06:05 AM
  3. Replies: 1
    Last Post: 04-15-2015, 05:50 AM
  4. Replies: 4
    Last Post: 08-12-2014, 08:47 AM
  5. Open a specific Excel application in Access
    By Hobbes29 in forum Programming
    Replies: 1
    Last Post: 02-14-2011, 06:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums