+ Reply to Thread
Results 1 to 6 of 6

Compile VBAProject

  1. #1
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Compile VBAProject

    Hi All,

    I have been using VBA for quite sometime now, but I have never used this so called feature.

    Can anyone tell me what the use of this option is?
    Attached Images Attached Images
    Cheers!
    Deep Dave

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Compile VBAProject

    Basically that checks if all your variables are declared correctly and if there is any typo. But you have to declare option explicit in the beginning of your module.

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Compile VBAProject

    Hi,

    Thank you for your reply.

    I always use Option Explicit and never run into an issue of incorrect variable declaration.

    But I am not sure how Compile VBAProject will help me figure out incorrect declarations?

    If I have a variable declared incorrectly without the Option Explicit Statement, wont it initialize it as a new variable?

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Compile VBAProject

    There rare times auto correction doesn't always work. But the main thing is just doing the syntax check.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Compile VBAProject

    VBA is a scripting language, not a compiled one. In a compiled language, declaring a wrong type will raise an error and caught by the complier before run time. Not even a compiler can pick up all declarations. If you declare x is as int, but meant to be long. Both are the same type, but the range differs- any error can only picked during run time.
    Last edited by AB33; 06-28-2018 at 04:01 AM.

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Compile VBAProject

    Hi, JieJenn & AB33,

    Thank you very much for your replies and clarification..

    Marking the thread solved and adding reps.

+ 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. VBAProject password
    By wayneg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-11-2016, 06:42 AM
  2. VBAProject password
    By Marcelo Rychter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2008, 09:28 AM
  3. VBAProject name compile error, not defined at compile time
    By Matthew Dodds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2005, 03:20 PM
  4. Debug/Compile VBAProject not available
    By milly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2005, 04:05 AM
  5. [SOLVED] VBAProject Properties
    By TimT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2005, 05:05 PM
  6. [SOLVED] VBAProject
    By Daniel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2005, 07:05 AM
  7. VBAProject (PERSONAL.XLS)
    By bigtonyicu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2005, 02:30 PM

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