Share via

Option Explicit will not work

Anonymous
2015-12-19T13:57:58+00:00

Option Explicit will not work.

I am writing Macros in Excel 2016 (office 365) and using Windows 10.  If I type Option Explicit into an otherwise empty macro  and then hit the run button I get the error message:

Compile Error

Invalid Procedure

This is problem one and I think it is related to my other problems, which I may write in the comments to this.

Microsoft 365 and Office | Excel | For home | 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

2 answers

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2015-12-19T14:48:30+00:00

    If I type Option Explicit into an otherwise empty macro  and then hit the run button I get the error message:

    You mean you tried this:

    Sub Test()

      Option Explicit

    End Sub

    That is of course a compile error, because "Option Explicit" is a compiler instruction and has to be placed on the top of a module.

    And about the RAM usage... might be related to your file and/or your macro. If we can't view it, we can't say anything.

    Andreas.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2015-12-19T14:18:48+00:00

    My next problem is that I am running a Macro that is taking on memory.  It was running at on point on this machine and operating system and then stopped.  It now goes up about 1500 mb of memory within 60 seconds of starting the program.  I made changes to improve the efficiency of the program, but it still goes up to 1500 mb of memory pretty quickly.  I managed to produce an error at one point about hidden procedures when I saved an updated version of the program.

    I do not know if the 2 problems are related.  I have tried to copy the macro into a new file, and I have tried to repair the office installation, and this, so far, has not worked.  When it was working, I think it was using about 300 mb of memory.

    Was this answer helpful?

    0 comments No comments