+ Reply to Thread
Results 1 to 2 of 2

sorry new to forum mac wont run macros built in office 2010

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    coventry
    MS-Off Ver
    excel 2013 mac
    Posts
    1

    sorry new to forum mac wont run macros built in office 2010

    i get this message every time i run any of macros on my mac machine but works perfect on my old pc
    Dim currdir as xpath



    Dim Shop As String
    Dim Invoice As Integer
    Dim vatABLE As Currency
    Dim VAT As Currency
    Dim zerorateafter As Currency
    Dim zeroratebefore As Currency
    Dim Credit As Currency
    Dim InvoiceTotal As Currency
    Dim Profit As Currency
    Dim rowcount As Integer
    Dim FileLoc As String
    Dim CurrDir As XPath
    Dim StPath As String
    Dim StFilename As String
    Dim Stfullname As String
    Dim StMonth As String


    Sub customer()
    Sheets("invoice").Range("I9").Value = (Sheets("invoice").Range("I9").Value) + 1

    k = Sheets("invoice").Range("h2").Value
    i = 1
    T = Sheets("invoice").Range("start").Value
    Do
    If k = T Then
    Sheets("invoice").Range("h3").Value = Sheets("invoice").Range("start").Offset(i, 1).Value
    Sheets("invoice").Range("h4").Value = Sheets("invoice").Range("start").Offset(i, 2).Value
    Sheets("invoice").Range("h5").Value = Sheets("invoice").Range("start").Offset(i, 3).Value
    Sheets("invoice").Range("h6").Value = Sheets("invoice").Range("start").Offset(i, 4).Value
    GoTo 1
    End If
    i = i + 1
    T = Sheets("invoice").Range("start").Offset(i, 0).Value
    Loop Until i = 200
    1 End
    'ActiveSheet.Unprotect
    ActiveWorkbook.Save


    End Sub
    'Sub Macro2()
    'n = MsgBox("Check your customer", 0, Save, 0, "Check your custoomer")
    'i = Sheets("Sheet1").Range("a1").CurrentRegion.Rows.Count
    ' Sheets("Sheet1").Range("a1").Offset(i, 0).Value = Sheets("invoice").Range("i9").Value
    'Sheets("Sheet1").Range("a1").Offset(i, 1).Value = Sheets("invoice").Range("i8").Value
    'Sheets("Sheet1").Range("a1").Offset(i, 2).Value = Sheets("invoice").Range("h2").Value
    'Sheets("Sheet1").Range("a1").Offset(i, 3).Value = Sheets("invoice").Range("i291").Value
    'Sheets("Sheet1").Range("a1").Offset(i, 4).Value = Sheets("invoice").Range("i288").Value
    'Sheets("Sheet1").Range("a1").Offset(i, 5).Value = Sheets("invoice").Range("i289").Value
    'Sheets("Sheet1").Range("a1").Offset(i, 6).Value = Sheets("invoice").Range("i292").Value
    'Sheets("Sheet1").Range("a1").Offset(i, 7).Value = Sheets("invoice").Range("i293").Value
    'Sheets("Sheet1").Range("a1").Offset(i, 8).Value = Sheets("invoice").Range("e301").Value
    'Sheets("invoice").PrintOut Copies:=2, Collate:=True
    'End Sub
    Sub Macro4()
    '
    ' Macro4 Macro
    ' Macro recorded 13/11/2009 by Carmel
    '

    '
    Sheets("invoice").SelectedSheets.PrintOut Copies:=2, Collate:=True
    End Sub

    Sub UseFileDialogOpen()

    Dim lngCount As Long

    ' Open the file dialog
    With Application.FileDialog(msoFileDialogOpen)
    .AllowMultiSelect = True
    .Show
    .Execute

    ' Display paths of each file selected
    For lngCount = 1 To .SelectedItems.Count
    MsgBox .SelectedItems(lngCount)
    Next lngCount

    End With
    End Sub



    Sub undome()
    ActiveSheet.Unprotect
    Sheets("clone").Select
    'ActiveSheet.Range("$A$12:$y$443").AutoFilter
    Range("Prodcopy").Select
    Selection.Copy
    Sheets("Invoice").Select
    ' ActiveSheet.Range("$A$12:$y$443").AutoFilter
    ActiveSheet.Unprotect
    Range("A13").Select
    ActiveSheet.PasteSpecial
    ' ActiveSheet.Range("$A$12:$y$443").AutoFilter
    Range("K4").Select
    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
    False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
    AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
    AllowUsingPivotTables:=True


    End Sub
    Sub CopyandSave()
    Dim nResult As Long
    nResult = MsgBox( _
    Prompt:="Have you printed and Is sales ledger closed?", _
    Buttons:=vbYesNo)
    If nResult = vbNo Then
    Exit Sub
    End If


    Dim StPath As String
    Dim StFilename As String
    Dim Stfullname As String
    Dim StMonth As String

    Shop = Worksheets("Invoice").Range("Shop")
    Invoice = Worksheets("Invoice").Range("Invoice")
    vatABLE = Worksheets("Invoice").Range("Vatable")
    VAT = Worksheets("Invoice").Range("Vat")
    zerorateafter = Worksheets("Invoice").Range("zerorateafter")
    zeroratebefore = Worksheets("Invoice").Range("zeroratebefore")
    Credit = Worksheets("Invoice").Range("Credit")
    InvoiceTotal = Worksheets("Invoice").Range("InvoiceTotal")
    Profit = Worksheets("Invoice").Range("profit")
    StPath = ThisWorkbook.Path



    'UseFileDialogOpen
    'update stock
    Sheets("invoice").Select
    ActiveSheet.Unprotect
    ActiveSheet.Range("All_col").AutoFilter Field:=11
    ActiveSheet.Range("All_col").AutoFilter Field:=1

    Range("M13:M425").Select
    Selection.Copy

    'unhide stock sheet
    Sheets("stock").Visible = True

    Sheets("Stock").Select
    Range("f4").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    'hide stock sheet
    Sheets("stock").Visible = False

    Sheets("Invoice").Select
    Range("B9").Select
    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
    False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
    AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
    AllowUsingPivotTables:=True

    Workbooks.Open Filename:=StPath & "\Sales Ledger.xlsm" '
    'Windows("sales Ledger.xlsm").Activate
    ActiveSheet.Unprotect
    rowcount = Worksheets("Main").Range("rowcount")
    Range("B" & rowcount).Select
    ActiveCell.FormulaR1C1 = Now()
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Range("C" & rowcount).Select
    ActiveCell.FormulaR1C1 = Shop
    Range("D" & rowcount).Select
    ActiveCell.FormulaR1C1 = Invoice
    Range("E" & rowcount).Select
    ActiveCell.FormulaR1C1 = zeroratebefore
    Range("F" & rowcount).Select
    ActiveCell.FormulaR1C1 = vatABLE
    Range("G" & rowcount).Select
    ActiveCell.FormulaR1C1 = VAT
    Range("H" & rowcount).Select
    ActiveCell.FormulaR1C1 = Credit
    Range("I" & rowcount).Select
    ActiveCell.FormulaR1C1 = InvoiceTotal
    Range("J" & rowcount).Select
    ActiveCell.FormulaR1C1 = Profit
    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
    False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
    AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
    AllowUsingPivotTables:=True
    'MsgBox ("Invoice details copied to sales ledger")
    ActiveWorkbook.Save
    ActiveWorkbook.Close

    'Save file

    Shop = Worksheets("Invoice").Range("Shop")
    Invoice = Worksheets("Invoice").Range("Invoice")
    StMonth = Worksheets("Invoice").Range("Cmonth")
    StPath = ThisWorkbook.Path

    ActiveSheet.Unprotect
    ActiveSheet.Range("All_col").AutoFilter Field:=1, Criteria1:="1"
    'Rows("13:426").Select
    'Selection.Delete Shift:=xlUp
    'ActiveSheet.Range ("$A$12:$AO$28").AutoFilter Field:=1
    Stfullname = StPath & "\" & StMonth & Shop & "_" & Invoice & ".xlsx"
    Sheets("Invoice").Select
    Sheets("Invoice").Copy
    ActiveWorkbook.SaveAs Filename:=Stfullname, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    ActiveWindow.Close
    Windows("invoice real_vers6.xlsm").Activate
    ' reset filter
    ActiveSheet.Range("Products").AutoFilter Field:=1
    Sheets("clone").Select
    Range("A12:L454").Select
    Selection.Copy
    Sheets("Invoice").Select
    Range("A12").Select
    ActiveSheet.PasteSpecial
    Range("K4").Select

    Range("units").Select
    Selection.ClearContents
    Range("B10").Select
    Selection.ClearContents
    Range("Picked").Select
    Selection.ClearContents
    Range("credit").Select
    Selection.ClearContents
    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
    False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
    AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
    AllowUsingPivotTables:=True
    ActiveWorkbook.Save
    ' To show only items with stock
    ActiveSheet.Unprotect
    ActiveSheet.Range("All_col").AutoFilter Field:=11, Criteria1:="3"
    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
    False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
    AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
    AllowUsingPivotTables:=True
    Range("B9").Select
    End Sub


    Sub filter2_3_1()

    Dim InvNum As Double
    Dim InvNumCopy As Double
    Dim Msg, Style, Title, Mystring As String



    ActiveSheet.Unprotect

    InvNum = Worksheets("Invoice").Range("InvNum")
    If InvNum = Worksheets("Invoice").Range("Inv_copynum") Then
    Msg = "STOP ! You have not increased the invoice number for this customer ! Click OK then push the red button and filter again " ' Define message.
    Style = vbOKOnly ' Define buttons.
    Title = "VF Cakes - Error Check" ' Define title.
    Response = MsgBox(Msg, Style, Title, Help, Ctxt)
    If Response = vbYes Then ' User chose Yes.
    Mystring = "Yes" ' Perform some action.
    Else ' User chose No.
    Mystring = "No" ' Perform some action.
    End If

    Else
    ActiveSheet.Range("$A$12:$AN$434").AutoFilter Field:=11, Criteria1:="2", Operator:=xlOr, Criteria2:="3"
    ActiveSheet.Range("$A$12:$AN$434").AutoFilter Field:=1, Criteria1:="1"
    Range("Inv_copynum").Select
    ActiveCell.FormulaR1C1 = InvNum
    InvNumCopy = Worksheets("Invoice").Range("Inv_copynum")
    Range("B9").Select

    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
    False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
    AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
    AllowUsingPivotTables:=True
    End If
    End Sub


    Sub PRINT_INVOICE()
    Dim nResult As Long
    nResult = MsgBox( _
    Prompt:="Have you filtered?", _
    Buttons:=vbYesNo)
    If nResult = vbNo Then
    Exit Sub
    End If
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
    IgnorePrintAreas:=False
    End Sub
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: sorry new to forum mac wont run macros built in office 2010

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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