+ Reply to Thread
Results 1 to 2 of 2

Debugging VBA built on Excel2013 not working on v2016

  1. #1
    Registered User
    Join Date
    10-26-2020
    Location
    Santiago, Chile
    MS-Off Ver
    2016
    Posts
    1

    Debugging VBA built on Excel2013 not working on v2016

    Hi!
    I am New here
    We updated recently to excel 2016 and when trying to run the onld VBAs we get errors in the code we did not get before the update... maybe there are changes we re not aware...

    Also, the code was developed by and external and have no clue what can be going wrong....



    We have the following code:



    HTML Code: 
    Sub MainReadOpenedFile()
    
    Application.ScreenUpdating = False
    
    GFILENAME = InputBox("Please type your File Name with .xlsx", , "File Name.xlsx")
    
    GPMLibraryMasterSheet = "PM Library (Master)"
    
    If Not Right(GFILENAME, 5) = ".xlsx" Then
    
    GoTo FileErrorHandler
    
    ElseIf GFILENAME = " " Then
    
    GoTo FileErrorHandler
    
    Else:
    
    Application.ScreenUpdating = False
    
    OpenFileCheck = False
    
    Call ReadDataFromFile
    
    End If
    
    Exit Sub
    
    FileErrorHandler:
    
    MsgBox "Not an Excel file, please try again"
    
    End Sub
    
    
    
    Sub ReadDataFromFile()
    
    Application.ScreenUpdating = False
    
    Dim PMRoutineInfo(4) As Variant
    
    Dim TLCInfo(4) As Variant
    
    Dim TLCActivityX() As Variant
    
    Dim PMCActivity() As Variant
    
    Dim Compliance As String
    
    Dim PMRoutineSchedule(10) As Variant
    
    Dim TableInfo() As Variant
    
    Dim TLCNo As String
    
    Dim ErrorMessage As String
    
    FirstRow = 3 'First row of file. LastRow if meets "End"
    
    PMStartRow = FirstRow
    
    Do While Not Range("D" & PMStartRow).Value = "End" 'to stop the loop (in column D)
    
    ''''
    
    Application.ScreenUpdating = False
    
    [B]Workbooks(OpenFile.GFILENAME).Activate
    
    Worksheets(OpenFile.GPMLibraryMasterSheet).Activate[/B]
    etc...



    But I have been getting errors on these last 2 lines: Run time error '9' "Subscript out of range"



    I am moving teams and must handover this soon, so was trying to test it to show it to my successor, but I cannot figure out what can be wrong here since I did not do the code, only guided the development of it, please your help!

    Thank you!!


    I have also posted this under these other forums:
    ozgrid
    vbaexpress
    mrexcel

    I tried several times to add the URLs but I get the message that I am "not allowed to post any kinds of links, images or videos until you post a few times."

    The issue was resolved, the problem with this is that it required that the workbook was opened in the same excel instance
    Last edited by Nyaralist; 10-27-2020 at 09:07 AM.

  2. #2
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    365
    Posts
    17,931

    Re: Debugging VBA built on Excel2013 not working on v2016

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 07-05-2019, 11:47 PM
  2. Formatting Cell Comments not working in Mac V2016
    By glindell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-29-2018, 06:31 PM
  3. [SOLVED] Help debugging mostly working Macro - inserting rows
    By svphc in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-30-2017, 03:58 PM
  4. [SOLVED] macro not working as expected, need someone good at debugging macro's
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 12-23-2015, 09:40 AM
  5. [SOLVED] Debugging Code... Strangely Not working!
    By Antligen in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-18-2014, 07:19 AM
  6. MACRO debugging but working in specific istances
    By ska87RA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2013, 08:19 AM
  7. macro built with Office 2003 not working on Office 2007
    By pako87 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-02-2009, 08:12 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1