#if, #else, #end if … what do the hash signs mean in VBA?

主宰稳场 提交于 2019-11-27 21:11:17

The hash symbols represent a preprocessor command, which are commands that are processed prior to compilation, essentially producing dynamic / conditional code. These types of commands are often used in languages such as C/C++ to manage cross-platform programming techniques. A common usage is to check for a particular environment or platform (ie. VBA, Windows, MacOSX, etc), and then implement platform-specific code.

http://en.wikipedia.org/wiki/Preprocessor

The hash indicates that it's a directive. Used for literally including or excluding code from compilation.

http://msdn.microsoft.com/en-us/library/7ah135z7.aspx

whoops that's for vb.net isn't it. Same concept I think.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!