Results 1 to 7 of 7

Object doesn't support...on certain computers

Threaded View

  1. #1
    Registered User
    Join Date
    05-11-2016
    Location
    Dallas, TX
    MS-Off Ver
    excel 2016
    Posts
    18

    Object doesn't support...on certain computers

    Dear All,
    I am a self taught VBA user and I'm sure my code is inefficient and sloppy but I usually end up getting it to do what I want. I've run into a snag and I'm completely lost. The following macro is a called macro that runs as intended on my machine. When my boss tries to run it (it's a tool for him) he gets the following error: "Object doesn't support this propery or method". I've run it step by step on his machine and I think I've identified where it fails.

    (FYI I am using Excel 2016 and he's using Excel 2013)

    ***UPDATE - I tried it on another coworker's machine with Excel 2016 and it worked find there as well

    ***UPDATE #2 - It also worked on a coworker's machine with Excel 2019.

    Thanks in advance for your assistance.

    Sub Sort_JobCosting()
    Dim wB As Workbook
        Dim pE As Worksheet
        Dim cC As Worksheet
        Dim cA As Worksheet
        Dim cM As Worksheet
        Dim rO As Worksheet
        Dim jC As Worksheet
        Dim x As Integer
        Dim y As Integer
        Dim z As Double
        Dim userResponse As String
        Set wB = ThisWorkbook
        Set pE = wB.Worksheets("Paste Expense")
        Set cC = wB.Worksheets("Control Center")
        Set cA = wB.Worksheets("Calculator")
        Set cM = wB.Worksheets("CURRENT MONTH")
        Set rO = wB.Worksheets("Roster")
        Set jC = wB.Worksheets("Job Costing")
        x = 4
        y = 2
        z = 0
        jC.Select
        
    Columns("A:I").Select
        jC.Sort.SortFields.Clear
    'the next line is where it fails
        jC.Sort.SortFields.Add2 Key:=Range( _
            "E2:E1200"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
            xlSortNormal
        jC.Sort.SortFields.Add2 Key:=Range( _
            "A2:A1200"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
            xlSortNormal
        jC.Sort.SortFields.Add2 Key:=Range( _
            "F2:F1200"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
            xlSortNormal
        With jC.Sort
            .SetRange Range("A1:G1200")
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
        Do Until jC.Cells(y, 1) = ""
    jmp:
            If jC.Cells(y, 1) = jC.Cells(y + 1, 1) And jC.Cells(y, 5) = jC.Cells(y + 1, 5) And jC.Cells(y, 6) = jC.Cells(y + 1, 6) Then
            z = z + jC.Cells(y, 4).Value
            y = y + 1
            GoTo jmp
            Else
            z = z + jC.Cells(y, 4).Value
            Rows(y + 1).Insert shift:=xlDown, _
            CopyOrigin:=xlFormatFromLeftOrAbove
            jC.Cells(y + 1, 3) = "Total:"
            jC.Cells(y + 1, 3).HorizontalAlignment = xlRight
            jC.Cells(y + 1, 3).Font.Bold = True
            'If z = 0 Then z = jC.Cells(y, 4).Value2
            jC.Cells(y + 1, 4) = z
            'jC.Cells(y + 1, 4).NumberFormat = "0.00"
            jC.Cells(y + 1, 4).Font.Bold = True
            y = y + 1
            End If
        z = 0
        y = y + 1
        Loop
              
    End Sub
    Last edited by gcerulli; 10-22-2019 at 04:44 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Object doesn't support this property or method - word object
    By Yakov on Excel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2017, 09:46 AM
  2. Object doesn't support this property or method
    By amartino44 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2013, 10:05 AM
  3. Error: Object doesn't support this property
    By Nancy123 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-28-2010, 06:58 AM
  4. Replies: 3
    Last Post: 06-14-2006, 02:10 PM
  5. [SOLVED] object doesn t support this property or metod
    By Ivica Lopar in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-09-2005, 04:35 PM
  6. [SOLVED] 438 - Object doesn't support this property or method
    By Revtim in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2005, 05:05 PM
  7. Object doesn't support this method
    By Andibevan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2005, 06:05 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