Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8560569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:18:19+00:00 2026-06-11T16:18:19+00:00

Here is my code, I am attempting, which works BTW on a PC, but

  • 0

Here is my code, I am attempting, which works BTW on a PC, but not on a Mac, to run this code and have an excel sheet created, named, add a tab, change the color of said tabs, change the name of said tabs, and then transpose the data while maintaining the format of the cells and width and height of the cells to the new worksheet.

This works, on a PC…. but when I get onto a Mac, it doesn’t.

I go into References, and this is what I see.

enter image description here

I see Ref Edit Control, and Microsoft Scripting Runtime are missing. I disabled both, and the script gives me an error here still:

wbBK2.SaveAs Dir & Application.PathSeparator & "Open Order Report -" & Format(Date, "mm-dd-yyyy") & ".xlsx"

The error happens at the (Date, "mm-dd-yyyy") Specifically the Date section. I can’t figure out why this is happening honestly. If someone can peruse this and give me an answer and a solution it be greatly appreciated.

The error I get is an Error '9 Subscript Out Of Range I can’t see a reason why this error only shows up on a Mac, and not a PC.

Option Explicit

Sub OpenOrderReportExport()

    Dim wsJL As Worksheet   'Jobs List
    Dim wsPOT As Worksheet  'PO Tracking
    Dim wsTNO As Worksheet  'Tel-Nexx OOR
    Dim wsDOO As Worksheet  'Dakota OOR
    Dim wbBK1 As Workbook   'Open Order Report
    Dim wbBK2 As Workbook   'New Workbook
    Dim wsWS1 As Worksheet  'Sheet1
    Dim wsWS2 As Worksheet  'Sheet2
    Dim wsWS3 As Worksheet  'Sheet3
    Dim wsWS4 As Worksheet  'Sheet4
    Dim CurrentFile As String, NewFileType As String, NewFile As String, Dir As String, lastrow As Long

    Set wsJL = Sheets("Jobs List")      'Jobs List
    Set wsPOT = Sheets("PO Tracking")   'PO Tracking
    Set wsTNO = Sheets("Tel-Nexx OOR")  'Tel-Nexx OOR
    Set wsDOO = Sheets("Dakota OOR")    'Dakota OOR
    Set wbBK1 = ThisWorkbook
    Set wbBK2 = Workbooks.Add           'New Workbook
    Set wsWS1 = wbBK2.Sheets("Sheet1")  'Sheet1
    Set wsWS2 = wbBK2.Sheets("Sheet2")  'Sheet2
    Set wsWS3 = wbBK2.Sheets("Sheet3")  'Sheet3


        Application.ScreenUpdating = False    ' Prevents screen refreshing.
        CurrentFile = ThisWorkbook.FullName
        NewFileType = "Excel Files 2007 (*.xlsx)"
        Dir = ThisWorkbook.path & Application.PathSeparator & "Reports"
        wbBK2.SaveAs Dir & Application.PathSeparator & "Open Order Report -" & Format(Date, "mm-dd-yyyy") & ".xlsx"
        Sheets.Add After:=Sheets(Sheets.Count)

    Set wsWS4 = wbBK2.Sheets("Sheet4")  'Sheet4

        With wbBK2
            Dim Sht As Worksheet
                For Each Sht In Worksheets
                    Sht.Tab.Color = 255
                Next
        End With

        Sheets("Sheet1").Name = "Jobs List"
        Sheets("Sheet2").Name = "PO Tracking"
        Sheets("Sheet3").Name = "Dakota OOR"
        Sheets("Sheet4").Name = "Tel-Nexx OOR"

        With wbBK1
            'Jobs List Export
            lastrow = wsJL.Range("B" & Rows.Count).End(xlUp).Row
            wsJL.Range("A2:N2").Copy
            wsWS1.Range("A1").PasteSpecial xlPasteAll
            wsJL.Range("A3:N" & lastrow).Copy
            wsWS1.Range("A2").PasteSpecial xlPasteValuesAndNumberFormats
            wsWS1.Range("A2").PasteSpecial xlPasteColumnWidths
            wsJL.Range("B3:N" & lastrow).Copy
            wsWS1.Range("B2").PasteSpecial xlPasteFormats
            wsWS1.Columns("A").Delete

            'Tel-Nexx Export
            lastrow = wsTNO.Range("B" & Rows.Count).End(xlUp).Row
            wsTNO.Range("A2:Q2").Copy
            wsWS2.Range("A1").PasteSpecial xlPasteAll
            wsTNO.Range("A3:Q" & lastrow).Copy
            wsWS2.Range("A2").PasteSpecial xlPasteValuesAndNumberFormats
            wsWS2.Range("A2").PasteSpecial xlPasteColumnWidths
            wsTNO.Range("B3:Q" & lastrow).Copy
            wsWS2.Range("B2").PasteSpecial xlPasteFormats
            wsWS2.Columns("A").Delete

            'Dakota Export
            lastrow = wsDOO.Range("B" & Rows.Count).End(xlUp).Row
            wsDOO.Range("A2:O2").Copy
            wsWS3.Range("A1").PasteSpecial xlPasteAll
            wsDOO.Range("A3:O" & lastrow).Copy
            wsWS3.Range("A2").PasteSpecial xlPasteValuesAndNumberFormats
            wsWS3.Range("A2").PasteSpecial xlPasteColumnWidths
            wsDOO.Range("B3:O" & lastrow).Copy
            wsWS3.Range("B2").PasteSpecial xlPasteFormats
            wsWS3.Columns("A").Delete

            'PO Tracking Export
            lastrow = wsPOT.Range("B" & Rows.Count).End(xlUp).Row
            wsPOT.Range("A2:K2").Copy
            wsWS4.Range("A1").PasteSpecial xlPasteAll
            wsPOT.Range("A3:K" & lastrow).Copy
            wsWS4.Range("A2").PasteSpecial xlPasteValuesAndNumberFormats
            wsWS4.Range("A2").PasteSpecial xlPasteColumnWidths
            wsPOT.Range("B3:K" & lastrow).Copy
            wsWS4.Range("B2").PasteSpecial xlPasteFormats
            wsWS4.Columns("A").Delete
        End With

        With wsWS1
            .Activate
            .Range("A1").Select
        End With
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:18:20+00:00Added an answer on June 11, 2026 at 4:18 pm

    the MISSING references are what are causing the problems. Remove the checkmarks there, and the basic stuff like date will start working again. If those references are critical to the code you are running, you will have to search out the Mac equivalents

    More about references – normally resolving “Missing” fixes it, but, from here

    What you’re describing is typical of corrupted references. This can
    be caused by a referenced file being a different version or in a different
    location between the machine on which the code was developed, and the
    client machines. Our company also tries to keep all the machines configured
    the same way, but I’ve found it’s essentially impossible to manage.

    Open any code module (or open the Debug Window, using Ctrl-G, provided you
    haven’t selected the “keep debug window on top” option). Select Tools |
    References from the menu bar. Examine all of the selected references.

    If any of the selected references have “MISSING:” in front of them, unselect
    them, and back out of the dialog. If you really need the reference(s) you
    just unselected (you can tell by doing a Compile All Modules), go back in
    and reselect them.

    If none have “MISSING:”, select an additional reference at random, back out
    of the dialog, then go back in and unselect the reference you just added. If
    that doesn’t solve the problem, try to unselect as many of the selected
    references as you can (Office may not let you unselect them all), back out
    of the dialog, then go back in and reselect the references you just
    unselected. (NOTE: write down what the references are before you delete
    them, because they’ll be in a different order when you go back in)

    Yes, disambigulating as VBA.xxxx will work, since Excel no longer has to
    look through all of the references.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to use the code found in the answer here: Directory.Move doesn't
I'm attempting to create a php template that includes object oriented code. Here's a
I commented my code below to reflect what I am attempting to do here.
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here my code, I need to insert into mysql database I have mysql,php,android 1)
I've a similar error to this one , but unfortunately not the same simple
The following code is a helper I've created for a system which allows administrators
I am attempting to combine this article and this article where I have a
I have a Windows form which hosts a custom User Control. This User Control
I have an application that I am attempting to build on Mac OS X

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.