0

I have had code working for years using Office 365. Recently purchased a company out of state and are setting up 2 computers for them to use with our system. On just 1 of the computers, I get a "application-defined or object-defined error" when the below code is ran, Sheets("ORDER").Select.

    Case "Order View"
        GoBack = ActiveSheet.Name
        Sheets("hist").Cells(Sheets("hist").Cells(1000, 3).End(xlUp).row + 1, 3) = ActiveSheet.Name
        **Sheets("ORDER").Select**

I have other Case conditions that select different sheets and they work fine. So I change the line to reference the index number of the sheet and it still fails!

        **Sheets(18).Select**

I put in different sheet Index numbers and they work fine, but I can't get my Order sheet to work.

Anytime I try to reference that 1 sheets' properties, my code crashes, but it's only on 1 computer out of probably 50! Even ActiveSheet.Name crashes when I am on the Orders sheet, but no other sheets.

Next, we uninstalled Office and reinstalled it and that did not fix it either.

Help!

Koop
  • 1
  • 2
  • 4
    You don't normally need to `Select` though. Maybe this is a good time to implement the points from [How to avoid using Select](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba). – BigBen Oct 30 '20 at 20:55
  • 2
    Probably a good first step would be to qualify all your worksheet references with a workbook object. – Tim Williams Oct 30 '20 at 21:06
  • On the computer which is having problems, try checking Tools > References in the VBA editor to make sure that none of the references are marked as "MISSING:" – barrowc Oct 30 '20 at 21:59
  • @BigBen My workbook has 69 sheets in it and I use the `Select` to navigate around to the different sheets. – Koop Nov 02 '20 at 15:19
  • 1
    But you shouldn't do that. – BigBen Nov 02 '20 at 15:19

0 Answers0