Consulting

Results 1 to 4 of 4

Thread: Excel VBA - causing issues

  1. #1
    VBAX Newbie
    Joined
    May 2021
    Posts
    2
    Location

    Excel VBA - causing issues

    HI
    I have written some reports for work using VBA. For some reason the report causes crashes on other versions of Excel -

    Crashes on Excel 2016 and earlier version yet runs on my Office 365.

    The second issue affecting my machine is that after scripts run sometimes it does not allow me to delete lines including VBA row.delete and in the worksheet after script has run. This also then affects the ability to do same in other workbooks if they are open.

    The reports take a handful of reports some from Connection using tables and other from copy and paste from other Excel files that are saved to a directory daily.
    I am not sure what is causing this error and have tried Google searches.

    Has anyone any knowledge of this and if it a corruption or a coding issue.
    Used to have a Sort error come up when I opened files which I have solved using sort.fields clear command.
    When the sort error came up I was able to clear the error but had to resave file as a new name.
    Possibly this is related.

    Any advice welcome and appreciated.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    365 is different from offline versions of Office. You may have to write two sets of code using Compiler Directives
    #If [365] Then 'Compile this code
    Some code
    #Else 'Compile this other code
    Some other code
    #End If
    I don't do 365, so other than that, I can't be of help. Hopefully someone smarter than I will chime in. It will help them if you post some of the troublesome code here.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Newbie
    Joined
    May 2021
    Posts
    2
    Location
    Thanks - I can get my scripts to work - but for some reason I can not then delete rows in my worksheets after the script has run

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Oh. We will definitely need to see the code.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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