Excel VBA error. Complie error: Wrong number of arguments or invalid code assignment

Anonymous
2021-02-19T17:02:18+00:00

I have been using a recorded Excel macro in Excel to reformat text and columns.  It has worked perfectly for months until today when the error below is produced.  I'm not a coder but I think this must be something simple I'm missing.

Any suggestions?

Frank

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

9 answers

Sort by: Most helpful
  1. Andreas Killer 144K Reputation points Volunteer Moderator
    2021-02-20T17:38:40+00:00

    When I pasted your code I found the following in a few instances.

    Image

    I removed the extra line feet space and the macro worked OK

    Hi Jeovany,

    this issue is due to the new forum editor. Please have a look at this article:
    https://answers.microsoft.com/en-us/msoffice/forum/all/vba-issues-with-new-forum-editor/5081b294-7ea7-4a86-870f-6b2834a0653b

    And the bug with "columns" in Franks code looks like a symthom of a missing reference to me, I would request the file.

    Andreas.

    0 comments No comments
  2. Anonymous
    2021-02-20T17:47:21+00:00

    Thank you Andreas

    Now I got it.

    Regards

    Jeovany

    0 comments No comments
  3. Anonymous
    2021-02-20T18:21:57+00:00

    Hi Andreas

    It's reassuring to know my issue was caused by a bug that my long and scruffy macro highlighted.

    So the macro ran as normal when I tried on my laptop. I installed the Office apps on both machines at the same time. How can I find the version numbers? I presume they will be different and one PC has been updated since the install.

    Frank

    0 comments No comments
  4. Andreas Killer 144K Reputation points Volunteer Moderator
    2021-02-21T07:51:53+00:00

    How can I find the version numbers?

    Frank,

    What do the version numbers help you? Not helpful for me in this case.

    If the file works on another machine means the issue is not due to the code or the file.

    I suggest to perform an online repair.

    Repair an Office application - Office Support

    Andreas.

    0 comments No comments