Results 1 to 3 of 3
  1. #1
    scotiwis is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2011
    Posts
    12

    Error exporting to Excel after 2016 upgrade

    Hi I have a database that's been working fine in Access 2013 but since the upgrade to Access 2016 I am getting an error in the VBA code that exports to excel.

    The error is:
    Unexpected error occurred: Type mismatch - Number: 13

    Below is a snippet of the VBA code, I trapped the error to the specific line noted:

    Sub MonthlyReport(xlWs As Excel.Worksheet, xlRng As Excel.Range)


    Dim db As DAO.Database
    Dim iRow As Integer

    Set db = Access.CurrentDb()

    iRow = 1

    Set xlRng = xlWs.Cells(iRow, 1) '**THIS LINE CAUSES THE ERROR
    With xlRng
    .Value = "Supplier"
    .Font.Bold = True
    .Font.Color = vbBlack
    .Font.Size = 10
    .Font.Underline = True
    End With

    Can anybody explain why this is happening.
    Thanks

  2. #2
    Geo21 is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2014
    Posts
    20
    It seems excel is missing from the Access libraries.

  3. #3
    scotiwis is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2011
    Posts
    12
    it was there, but turns out I had to remove and add it again then everything worked. Thanks

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

Similar Threads

  1. cant open database after 2016 upgrade
    By BobW2961 in forum Access
    Replies: 1
    Last Post: 07-24-2017, 07:30 AM
  2. Upgrade accde from 2013 to 2016
    By aldol in forum Access
    Replies: 1
    Last Post: 03-25-2017, 04:19 AM
  3. Error in VBA Code of Exporting Query Data to Excel
    By kirky in forum Import/Export Data
    Replies: 3
    Last Post: 02-09-2017, 08:47 PM
  4. Replies: 3
    Last Post: 08-17-2016, 08:26 AM
  5. Replies: 6
    Last Post: 06-27-2013, 12:38 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