Results 1 to 10 of 10
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: buy new pc: run Excel macro

    See http://www.standards.com/index.html?MacroRecording

    The code generated by recorded macros is almost always slower, not to mention that it is almost always incomplete or not what you wanted.

    Yes, I am proudly an anti-macrorecording bigot!!
    That's my constitutional right!!

  2. #2
    Gold Lounger Rebel's Avatar
    Join Date
    Jul 2001
    Location
    Canada
    Posts
    3,024
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: buy new pc: run Excel macro

    Obviously, you must have meticulously timed many many macros to arrive at this conclusion. On average, how much slower do recorded macros run than "straight code".? - milliseconds, seconds, minutes ???????
    "it is almost always incomplete or not what you wanted."
    Again, you have provided AN (one) example. How many "recorded macros" produce "incomplete" or "not what you wanted" code? If this is the case, then macros are indeed very unreliable. I have recorded many many macros and they are seeming to do what I want them to do. Am I simply being hoodwinked ??? I assume you have reported this glaring error to MS and I would assume that the folkes at MS have responded to your error reports?
    John
    A Child's Mind, Once Stretched by Imagination...
    Never Regains Its Original Dimensions

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: buy new pc: run Excel macro

    It is widely known that record macros, in general, produce inefficient code, and more often than not, code that is incomplete.
    This is stated in books and MSFT KB articles.

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: buy new pc: run Excel macro

    I agree that recording tends to produce inefficient code, but it is an incredibly useful technique for people who don't have an encyclopaedic knowledge of the object model. It generally produces "good enough" code for most purposes - but if you need high performance code then you do need to hand craft it.

    StuartR

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: buy new pc: run Excel macro

    Recording code causes at least the following problems:

    1. Perpetuates bad code as folkes copy the code elsewhere.
    2. Makes folkes rely on the Selection, instead of Rangem object.
    3. Traps lots of folkes into doing tumble saults when the code is either incomplete or needs to be changed so that it runs correctly.

    Oh well, on to other things!

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: buy new pc: run Excel macro

    Howard,

    I absolutely agree with all your points, but recorded macros
    <UL><LI>Allow people with no programming experience to automate simple tasks
    <LI>Help people to identify the names of methods and properties that they can then use in "proper" code
    <LI>Are perfectly good enough for many purposes where the code is simple and not run frequently[/list]I am now going to move these replies talking about the limitations of recorded Macros to the VBA board, as they have little to do with hardware.

    StuartR

  7. #7
    2 Star Lounger
    Join Date
    Aug 2004
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    buy new pc: run Excel macro

    This set of replies was moved here from the Hardware board by <!profile=StuartR>StuartR<!/profile>. They were originally posted as replies to <post#=425930>post 425930</post#>

    hi Howard Kaikow. now i understand. one more thing i want to check with you, normally, or is it, recorded macro run more faster than vba programmed macro (of the same task) or vice versa.

    thanks for your advice.

    Edit: one more thing, what do you mean by 'ALL dat'. 'dat', is it data?

  8. #8
    2 Star Lounger
    Join Date
    Aug 2004
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: buy new pc: run Excel macro

    hi all. thank you for so many expert advices. i do agree macro recording is for beginner and vba programming is for advance user. and i also realise vba programming language learning is not quite easily adaptable by every person.

    thanks.


    Edit: one more question about macro please, is it harmful to pc or software or in anyway, if i often cancell a macro that is running, meaning i press Esc to cancell it. thanks.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: buy new pc: run Excel macro

    If you use a lot of object variables (the kind you assign a value with Set varname = value), canceling a macro may leave the memory used by the object in use. If you do this a lot during a session, the amount of available memory may decrease. But this is only temporary, it will in no way harm your computer. Next time you start your computer, all memory will be available again.

  10. #10
    2 Star Lounger
    Join Date
    Aug 2004
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: buy new pc: run Excel macro

    ok Hans. i kind of get it. Thanks.

Posting Permissions

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