Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Compile VBAProject under Debug menu in VBA

  1. #1
    New Member
    Join Date
    Feb 2002
    Location
    Wisconsin
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Does it do anything?? I wrote a short VBA program and hit Compile VBAProject. It did something very fast but gave no indication of what it did???
    I looked up 'Compile' in help with NO results.

    What is it for???

    Thank you.

  2. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I believe compiling just checks to verify that your syntax is correct and that there are no obvious errors (DO statement without a LOOP ending, for example).

    Regards,

    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    BTW

    I use this as Mark says and just help if im miss something also step through in test stages can be cool.

    Short scripts are not so painful, 100 lines of complex code and 3 cases doing bits with loops all give agro to the programmer this can help.. I dont use VBA Checker software thats about, no reason just dont..

    HTH

    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Well, first message in a while, don't know when I'll be back again...

    Just to let you know, Compiling projects actually has some effects in the program. Whenever the macro is run, VB compiles the macro to "translate" it into machine code, (Well, something very similar to this). The truth is that a VB Project has three (As far as I remember...) stages, two of them are "P" code and "X" code (This is just by memory from an article I read a while, so, I may be wrong with the letters). When you compile, VB translates from one to the other, which makes it run much faster.

    So, in big projects, it's a good idea to compile BEFORE saving, that way the program has ALREADY translated the code, and there's no need to translate it at the beginning, which results in faster loading times. It has no "visible" effect on small programs.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I find myself with the need of understanding the 'compile vbaproject' option.
    As I just executed this and it doubled the size of my workbook. From about 500k to 1.07mb.
    Is this normal. Or is there something else?????

    Thanks in advance,
    -D

  6. #6
    Board Regular
    Join Date
    Sep 2011
    Location
    India
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Compile VBAProject under Debug menu in VBA

    Quote Originally Posted by d-alan View Post
    I find myself with the need of understanding the 'compile vbaproject' option.
    As I just executed this and it doubled the size of my workbook. From about 500k to 1.07mb.
    Is this normal. Or is there something else?????

    Thanks in advance,
    -D
    Back from the dead...
    Will Compiling speed up the running of the code?

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •