+ Reply to Thread
Results 1 to 20 of 20

Some of us can run macros fine, but others can not...

Hybrid View

  1. #1
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Question Some of us can run macros fine, but others can not...

    Hi all,

    Does anyone know why some of our users can run Macros, but others can not? They enable content, and open the .xlsm from the same place as us, but they get the run time errors as seen in the attachments. For other users it works fine... Very random.

    Error.JPG

    Thanks guys,

    Ben

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,989

    Re: Some of us can run macros fine, but others can not...

    Please post the VBA code - it's unlikely to be random, but unless we know what's in the code and at which point it is causing the error, we can't begin to help.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Some of us can run macros fine, but others can not...

    Hi,

    I tried to attach the xlsm but it wouldnt let me. Ill paste the code below instead.

    Cheers!

    Sub Outdated_LatinsEng()
    '
    ' Outdated_LatinsEng Macro
    ' Replaces outdated latins with the new versions
    '
    
    '
        Range("Table1[[#All],[Scientific Name]]").Select
        ActiveWindow.SmallScroll Down:=-40
        Columns("C:C").Select
        Range("C20").Activate
        ActiveWindow.SmallScroll Down:=-65
        Range("Table1[[#Headers],[Scientific Name]]").Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        ActiveWindow.SmallScroll Down:=-125
        Selection.Replace What:="Acanthis cabaret", Replacement:= _
            "Carduelis cabaret", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:= _
            False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
            xlReplaceFormula2
        Selection.Replace What:="Carduelis cannabina", Replacement:= _
            "Linaria cannabina", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:= _
            False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
            xlReplaceFormula2
        Selection.Replace What:="Carduelis linaria", Replacement:= _
            "Linaria cannabina", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:= _
            False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
            xlReplaceFormula2
        Selection.Replace What:="Lacerta vivipara", Replacement:="Zootoca vivipara" _
            , LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat _
            :=False, ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
        Selection.Replace What:="Triturus helveticus", Replacement:= _
            "Lissotriton helveticus", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase _
            :=False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
            xlReplaceFormula2
        Selection.Replace What:="Triturus vulgaris", Replacement:= _
            "Lissotriton vulgaris", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase _
            :=False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
            xlReplaceFormula2
        Selection.Replace What:="Calaena leucostigma", Replacement:= _
            "Helotropha leucostigma", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase _
            :=False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
            xlReplaceFormula2
        Selection.Replace What:="Celaena leucostigma", Replacement:= _
            "Helotropha leucostigma", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase _
            :=False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
            xlReplaceFormula2
        ActiveSheet.Shapes.Range(Array("Button 3")).Select
        Selection.Delete
        Range("R3:S6").Select
        ActiveCell.FormulaR1C1 = "Rename latins done."
        Range("A1").Select
    End Sub
    Last edited by AliGW; 07-07-2020 at 06:44 AM.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Some of us can run macros fine, but others can not...

    Is your code being called automatically when the workbook opens?
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Some of us can run macros fine, but others can not...

    No it is launched when clicking a button with the macro assigned.

    This is the bit highlighted when clicking debug.

    Attachment 685626
    Last edited by BB1988; 07-07-2020 at 06:50 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,989

    Re: Some of us can run macros fine, but others can not...

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I have done it for you today.)

  7. #7
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Some of us can run macros fine, but others can not...

    Thank you - I will remember for next time.

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Some of us can run macros fine, but others can not...

    Your attachment doesn't work, by the way. Which line is highlighted?

  9. #9
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Some of us can run macros fine, but others can not...

    Attachment 685633

    Does this one work?

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Some of us can run macros fine, but others can not...

    Are you all using the same version of excel?

    The online help suggests the replace method uses these arguments
    expression.Replace (What, Replacement, LookAt, SearchOrder, MatchCase, MatchByte, SearchFormat, ReplaceFormat)


    The object browser in O365 returns
    Function Replace(What, Replacement, [LookAt], [SearchOrder], [MatchCase], [MatchByte], [SearchFormat], [ReplaceFormat], [FormulaVersion]) As Boolean


    FormulaVersion appears to be a new argument.
    Cheers
    Andy
    www.andypope.info

  11. #11
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Some of us can run macros fine, but others can not...

    Yes we are using the same version of Excel.

  12. #12
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Some of us can run macros fine, but others can not...

    The post a workbook, currently none of you links are working.

    There is a big yellow banner at the top of the page with instructions on how to post workbook

  13. #13
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Some of us can run macros fine, but others can not...

    Strange. I can click on the links and they open up the images.

    I have tried to follow the instructions in the yellow banner but it says upload of file failed. I have shared a sample of the file on oneDrive but I cant post links as I am new. FML.

    Really appreciate any help you can give.

  14. #14
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Some of us can run macros fine, but others can not...

    Can you just tell us which line is highlighted by the debugger?

  15. #15
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Some of us can run macros fine, but others can not...

    Yes it is line 17 to line 20 all highlighted yellow.

  16. #16
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Some of us can run macros fine, but others can not...

    Since there aren't any line numbers in your code, could you just paste the line here?

  17. #17
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Some of us can run macros fine, but others can not...

    Sure it is:

        Selection.Replace What:="Acanthis cabaret", Replacement:= _
            "Carduelis cabaret", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:= _
            False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
            xlReplaceFormula2

  18. #18
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: Some of us can run macros fine, but others can not...

    Try removing the part in red
    Selection.Replace What:="Acanthis cabaret", Replacement:= _
            "Carduelis cabaret", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:= _
            False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
            xlReplaceFormula2

  19. #19
    Registered User
    Join Date
    02-27-2020
    Location
    Southampton, England
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Some of us can run macros fine, but others can not...

    Many thanks Fluff13 this has solved the issue

    Thanks also to rorya for help and persistence

  20. #20
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: Some of us can run macros fine, but others can not...

    Glad we could help & thanks for the feedback.

    For reference, whilst you may all be using 365, you don't all have the same update version.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 02-27-2019, 02:32 PM
  2. [SOLVED] Help with modifying VBA Macro - Works fine but needs fine tuning !
    By stefan27 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-06-2015, 10:27 AM
  3. [SOLVED] Old files - Excel Macros stopped working - new ones fine
    By rscsmith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2015, 12:01 PM
  4. Hello to this fine comunity
    By Proditech Orion in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-18-2014, 02:30 PM
  5. [SOLVED] hi i have formula it's working fine but i want to Automatically run macros at Specified.
    By vikas2424 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-14-2012, 01:21 PM
  6. Macros working fine on Windows Excel, but not on Mac (Excel 2011)
    By mcstenger85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-08-2012, 08:52 AM
  7. Macros working fine on Windows (Excel 2010), but not on Mac (Excel 2011)
    By six6to8eight in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-29-2012, 11:12 PM

Tags for this Thread

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