Consulting

Results 1 to 6 of 6

Thread: VBA code of Excel 2013 is not working in Excel 2010

  1. #1
    VBAX Newbie
    Joined
    Apr 2015
    Posts
    3
    Location

    VBA code of Excel 2013 is not working in Excel 2010

    Dear,
    Can anybody know why VBA code of Excel 2013 "workbooks.open" not working with Excel 2010?
    I found below error. Please let me know.
    Error 1: System Error &H80070BBC (-2147021892).
    Error 2: Run-timeerror '-2147021892 (80070bbc)':
    Automation error
    An AddJob call was not issued.
    Please find below code that is working fine with Excel 2013 where give errors in Excel 2010
    ---------------------------------------------------------------------------------------------------------
    Sub Update_Click()
         Dim path As String
        Dim currentWb As Workbook
        Dim openWb As Workbook
        Dim openWs As Worksheet
         path = "C:\Users\20049467\Desktop\KP-I1-0201.xls"
    
         Set currentWb = ThisWorkbook
        Set openWb = Workbooks.Open(path)
        Set openWs = openWb.Sheets("Cable_Schedule")
         openWs.Range("L6") = currentWb.Sheets("Document List").Range("B2")
        openWs.Range("L7") = currentWb.Sheets("Document List").Range("C2")
        openWs.Range("E19") = currentWb.Sheets("Document List").Range("D6")
         ActiveWorkbook.Save
                
        openWb.Close (False)
         ActiveSheet.Shapes("CCS").ControlFormat.Value = 0
    
     End Sub
    fetchimage.axd.jpg
    fetchimage.axd1.jpg
    Last edited by Aussiebear; 04-23-2015 at 11:51 PM. Reason: Hash tagged the code section

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    I can't see anything there that would be incompatible. Is there any code in the workbook you are opening?
    Be as you wish to seem

  3. #3
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Try opening the file manually. If it has Protected View, then you might want to look explore turning it off, but it could be a risk. http://www.webtlk.com/2010/01/04/how...n-office-2010/

  4. #4
    VBAX Newbie
    Joined
    Apr 2015
    Posts
    3
    Location

    Thanks for Reply "VBA code of Excel 2013 is not working in Excel 2010"

    Quote Originally Posted by Aflatoon View Post
    I can't see anything there that would be incompatible. Is there any code in the workbook you are opening?
    There is no code in the workbook that I am opening.

  5. #5
    VBAX Newbie
    Joined
    Apr 2015
    Posts
    3
    Location
    Hi Kenneth Hobs,
    Thanks for Reply.
    I tried to opening file manually. There is not any protected view. It open normally.
    Kindly try to copy this code in Excel VBA 2010 and try to run.
    THanks again.

  6. #6
    VBAX Newbie
    Joined
    Apr 2011
    Location
    Winthrop, Western Australia
    Posts
    1
    Location
    Is it possible that you have the wrong references set? Remember that if there are references set to Excel or other office components the references will be updated to the newer version which will then cause a problem when you use the same vba code in an earlier version.

    Because our organisation has different versions of excel opening the same spreadsheets we use code to reset the references and in some instances use late binding instead of early binding when referencing other applications.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •