Macro crashes on Mac but works on PC

Eskypades

Board Regular
Joined
Nov 19, 2009
Messages
98
I have the following code in my worksheet (forgive the crude coding). It works just fine on my PC but when I send the worksheet to my client and he runs it on a Mac, it crashes Excel. The crash report is 48 pages long and includes the following error message:

"Error Signature:
Exception: EXC_BAD_ACCESS
ExceptionEnumString: 1
Exception Code: KERN_INVALID_ADDRESS (0x0000000000000000)"

Since I don't have a Mac, I'm unsure what is causing the problem in my coding. Any help would be greatly appreciated.

Code:
Sub Update()

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False

Set Rng = Worksheets("Stock").Range("A2:A100000")

' Count the number of rows that have data

    RowCount = Application.WorksheetFunction.CountA(Rng)


    Sheets.Add After:=ActiveSheet
    ActiveSheet.Name = "Calc"
    Range("A1").Value = "SOLD"
    Range("A2").Formula = "=Sold+SUMIF(Import!$M:$M,STOCK!A2,Import!$N:$N)"
    Range("A2").Select
    Selection.Copy
    Range("A2" & ":" & ("A" & RowCount + 1)).Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("A1:" & "A" & RowCount + 1).Select
    Selection.Copy
    Sheets("STOCK").Select
    Range("Sold").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
    Sheets("Import").Select
    Cells.Select
    Selection.ClearContents
    Sheets("Calc").Select
    ActiveWindow.SelectedSheets.Delete
    Sheets("STOCK").Select
    Range("A1").Select

    Application.DisplayAlerts = True
    Application.ScreenUpdating = True

End Sub

Thanks,
Stephen
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
i can't see where the problem lies, if you developed with activex then that has to come out, there will be workarounds for many things, if you are going to work with people who use mac then they need to lend you a machine or you buy one to test from
 
Upvote 0

Forum statistics

Threads
1,215,330
Messages
6,124,305
Members
449,150
Latest member
NyDarR

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top