Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Visual Basic for mAsochists (VBA)

Visual Basic for mAsochists (VBA)

Scheduled Pinned Locked Moved The Lounge
helploungecsharpjava
37 Posts 29 Posters 44 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Saul Johnson

    Now before I start this rant, I mean no insult to any VBA programmers out there reading this. I could not have greater admiration for you for succeeding where I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code. I want to get the general consensus on this, as it has been bugging me no end. My first gripe is that the VBA programming environment that comes with Office (2007) is to my eyes just utter tat. It is currently removing and inserting random whitespace here there and everywhere in what seems to be an overtly malicious attempt to mess with my head. The 'intellisense' and 'syntax highlighting' leave much to be desired, but I could whine about that all day, so I'll stop there. In my opinion however, the absolute worst thing about the VBA editor that shipped with Excel 2007 is... The environment alerts you to coding errors with - get this - a MODAL messagebox that totally interrupts what you're trying to accomplish by screaming in your face until you click the stupid 'OK' button. Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel. So far this project, I have been repeatedly flummoxed by the arcane, esoteric knowledge of all the peculiarities of VBA that seems to be required to do anything at all in the language with any degree of efficiency. While I am far from being a VB guru, VB.NET is my main programming language alongside Java and also my main source of income. I was astonished to find that my half a decade of VB.NET experience did not help one jot with VBA. Is this just me? Please tell me, because I'm not sure if the problem is on my end (very possible) or with whichever dark ritual was used to create this 'programming language' in the first place.

    A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.

    _ Offline
    _ Offline
    _beauw_
    wrote on last edited by
    #13

    If you really want to experience a nightmare, try doing Access VBA development. For some reason, everything seems to devolve into a half-dozen or more top-level windows flying in close formation, each with its own cryptic-looking icon. It's the opposite of an IDE... I guess it's a Dis-integrated Development Environment (DDE).

    P 1 Reply Last reply
    0
    • _ _beauw_

      If you really want to experience a nightmare, try doing Access VBA development. For some reason, everything seems to devolve into a half-dozen or more top-level windows flying in close formation, each with its own cryptic-looking icon. It's the opposite of an IDE... I guess it's a Dis-integrated Development Environment (DDE).

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #14

      :thumbsup:

      "I've seen more information on a frickin' sticky note!" - Dave Kreskowiak

      1 Reply Last reply
      0
      • S Saul Johnson

        Now before I start this rant, I mean no insult to any VBA programmers out there reading this. I could not have greater admiration for you for succeeding where I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code. I want to get the general consensus on this, as it has been bugging me no end. My first gripe is that the VBA programming environment that comes with Office (2007) is to my eyes just utter tat. It is currently removing and inserting random whitespace here there and everywhere in what seems to be an overtly malicious attempt to mess with my head. The 'intellisense' and 'syntax highlighting' leave much to be desired, but I could whine about that all day, so I'll stop there. In my opinion however, the absolute worst thing about the VBA editor that shipped with Excel 2007 is... The environment alerts you to coding errors with - get this - a MODAL messagebox that totally interrupts what you're trying to accomplish by screaming in your face until you click the stupid 'OK' button. Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel. So far this project, I have been repeatedly flummoxed by the arcane, esoteric knowledge of all the peculiarities of VBA that seems to be required to do anything at all in the language with any degree of efficiency. While I am far from being a VB guru, VB.NET is my main programming language alongside Java and also my main source of income. I was astonished to find that my half a decade of VB.NET experience did not help one jot with VBA. Is this just me? Please tell me, because I'm not sure if the problem is on my end (very possible) or with whichever dark ritual was used to create this 'programming language' in the first place.

        A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.

        J Offline
        J Offline
        Jonathan C Dickinson
        wrote on last edited by
        #15

        I don't think Microsoft want you to use VBA any more - you can now use .Net to do exactly the same stuff[^]. You still need to know the ghastly innards of Office COM automation but it should be that little less frustrating. Jake Ginnivan also has a pretty nice library[^] that should help you with your COM headaches. Also remember, if you want to distribute your spreadsheet, that VBA is now an optional installation component (turned off by default from what I remember), where VSTO is always installed (from what I remember :D). It is putrid though, if you want worse try writing extensive Visual Studio plugins (project systems, debuggers, etc.).

        He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Chinese Proverb] Jonathan C Dickinson (C# Software Engineer)

        F 1 Reply Last reply
        0
        • S Saul Johnson

          Now before I start this rant, I mean no insult to any VBA programmers out there reading this. I could not have greater admiration for you for succeeding where I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code. I want to get the general consensus on this, as it has been bugging me no end. My first gripe is that the VBA programming environment that comes with Office (2007) is to my eyes just utter tat. It is currently removing and inserting random whitespace here there and everywhere in what seems to be an overtly malicious attempt to mess with my head. The 'intellisense' and 'syntax highlighting' leave much to be desired, but I could whine about that all day, so I'll stop there. In my opinion however, the absolute worst thing about the VBA editor that shipped with Excel 2007 is... The environment alerts you to coding errors with - get this - a MODAL messagebox that totally interrupts what you're trying to accomplish by screaming in your face until you click the stupid 'OK' button. Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel. So far this project, I have been repeatedly flummoxed by the arcane, esoteric knowledge of all the peculiarities of VBA that seems to be required to do anything at all in the language with any degree of efficiency. While I am far from being a VB guru, VB.NET is my main programming language alongside Java and also my main source of income. I was astonished to find that my half a decade of VB.NET experience did not help one jot with VBA. Is this just me? Please tell me, because I'm not sure if the problem is on my end (very possible) or with whichever dark ritual was used to create this 'programming language' in the first place.

          A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.

          C Offline
          C Offline
          CHill60
          wrote on last edited by
          #16

          Ah VBA! I love it, love it, love it! Before you all dismiss me as completely and utterly mad, imagine the scenario ... 1. In the dark and distant past a user discovers Excel macros and starts to "automate" certain daily functions 2. It soon becomes all too much for them to handle so the macros get passed to an "IT contractor" to be brought up to production strength (an oxymoron if ever there was). Note that at this point the IT department still know nothing about this 3. In the meantime these spreadsheets somehow manage to become business critical "applications" 4. Eventually someone in the user department has an epiphany - or it might have been an audit finding - and said piece of s**t is passed over to the IT department to support. 5. By now the business-critical excel "application" consists of more than 120 spreadsheets mashed together like a web built by a hundred drunken spiders 6. Enter yours truly ... the re-engineering of various parts of this mess (when allowed to by the red-tape afficiandos) has kept me in gainful employment for some considerable time!! :-D p.s. around here "VBA" is known as "Visual Basic for Amateurs"

          S C O E 4 Replies Last reply
          0
          • R rbuchana

            You can turn off the message box via Tools->Options->Auto Syntax Check

            S Offline
            S Offline
            Sentenryu
            wrote on last edited by
            #17

            you sir, you hacked life.

            I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)

            1 Reply Last reply
            0
            • S Saul Johnson

              Now before I start this rant, I mean no insult to any VBA programmers out there reading this. I could not have greater admiration for you for succeeding where I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code. I want to get the general consensus on this, as it has been bugging me no end. My first gripe is that the VBA programming environment that comes with Office (2007) is to my eyes just utter tat. It is currently removing and inserting random whitespace here there and everywhere in what seems to be an overtly malicious attempt to mess with my head. The 'intellisense' and 'syntax highlighting' leave much to be desired, but I could whine about that all day, so I'll stop there. In my opinion however, the absolute worst thing about the VBA editor that shipped with Excel 2007 is... The environment alerts you to coding errors with - get this - a MODAL messagebox that totally interrupts what you're trying to accomplish by screaming in your face until you click the stupid 'OK' button. Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel. So far this project, I have been repeatedly flummoxed by the arcane, esoteric knowledge of all the peculiarities of VBA that seems to be required to do anything at all in the language with any degree of efficiency. While I am far from being a VB guru, VB.NET is my main programming language alongside Java and also my main source of income. I was astonished to find that my half a decade of VB.NET experience did not help one jot with VBA. Is this just me? Please tell me, because I'm not sure if the problem is on my end (very possible) or with whichever dark ritual was used to create this 'programming language' in the first place.

              A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.

              B Offline
              B Offline
              BillWoodruff
              wrote on last edited by
              #18

              Are you using VBA with Macintosh Excel 2011 / OSX because you need your whatever to run on a Macintosh, as well as Windows: if that's the case, then there's not much you can do, since VSTO is out. I think you are making the assumption that your programming skills in Visual Basic .NET should have "payback" in using the "original" VBA: that's an assumption I question. I do think your investment in Visual Basic .Net should have payback in using VSTO in Excel for Windows. Experience in programming pre-.NET versions of VB, on the other hand, was of value in programming VBA when it first appeared. When VBA arrived (in the late neolithic ... circa 1995 ... the time of Windows 95, and Excel 95), it replaced the incredibly clumsy "macro" facility. It gave VB programmers of that time a way to use what they knew. And, yes, if you wrote linguini-code in VB, you would probably write fettucine-code in VBA :) People (like this flea currently writing here) got major work, back then, replacing per-project custom-macro consultants, whose work could not be re-used: replacing one-off inscrutable Macro sheets with generic VBA solutions, which could be re-used: even maintained without re-hiring the original macro consultant ! So, circa 1995, I did a 6000 lines of VBA (plus about 2000 lines of comments) custom application for a major world energy company that modeled the very complex financing of the construction period for energy-plants that had many lenders, of many types (international export-import banks run by national governments, host-country investment, private banks, etc.). Each lender might have different constraints for use of funds, and different methods of calculating payment of interest for their share of monetary contribution (on both funds already spent, and funds not yet spent) during each phase of the construction period. Expenditures per month of construction period were based on a primary-contractor supplied set of data, the "S-Curve", that told you what percentage of the actual construction cost was required to be drawn-down for each month. So, the calculation of the true cost of the project for each month of construction (actual construction cost + all interest costs) required recursive manipulation to determine (via Excel's "Solver" facility). Not simple stuff ! This Excel-application could run on either PC or Macintosh hardware (of that time), with the only platform requirements being taking into account possible screen-size variations. Being able to run on both platforms was, at the time

              1 Reply Last reply
              0
              • S Saul Johnson

                Now before I start this rant, I mean no insult to any VBA programmers out there reading this. I could not have greater admiration for you for succeeding where I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code. I want to get the general consensus on this, as it has been bugging me no end. My first gripe is that the VBA programming environment that comes with Office (2007) is to my eyes just utter tat. It is currently removing and inserting random whitespace here there and everywhere in what seems to be an overtly malicious attempt to mess with my head. The 'intellisense' and 'syntax highlighting' leave much to be desired, but I could whine about that all day, so I'll stop there. In my opinion however, the absolute worst thing about the VBA editor that shipped with Excel 2007 is... The environment alerts you to coding errors with - get this - a MODAL messagebox that totally interrupts what you're trying to accomplish by screaming in your face until you click the stupid 'OK' button. Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel. So far this project, I have been repeatedly flummoxed by the arcane, esoteric knowledge of all the peculiarities of VBA that seems to be required to do anything at all in the language with any degree of efficiency. While I am far from being a VB guru, VB.NET is my main programming language alongside Java and also my main source of income. I was astonished to find that my half a decade of VB.NET experience did not help one jot with VBA. Is this just me? Please tell me, because I'm not sure if the problem is on my end (very possible) or with whichever dark ritual was used to create this 'programming language' in the first place.

                A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.

                C Offline
                C Offline
                Cindy Meister
                wrote on last edited by
                #19

                As others have said, VBA does pre-date the Visual Studio IDEs, so it's a bit "unfair" to be upset about an IDE that originated almost twenty years ago :-) Compared to what we had to work with prior to that, it was true luxury, whether you worked in Word or Excel. (PowerPoint didn't even have a programming interface, at the time.) And FWIW it's almost as difficult for VBA people moving to VB.NET when it comes to "keeping one's balance". Working in a new IDE is always a challenge because you're on auto-pilot when you go to the tools you use regularly - and they aren't in the same place, are labelled different or look different... Heck, Visual Studio 2012 has changed the icons, labels and placing of so many things it's a pain to work in there after "living" so long in the 2008/2010 IDEs! How different or similar VB.NET and VBA are also depend on whether you use the Microsoft.VisualBasic namespace for functionality, or work with that native to the .NET Framework. The VisualBasic namespace is there to help people migrating from classic VB(A), but if you "do it right", the VB.NET language has very little resemblence to classic VB(A). About the only thing that stays the same - IF you work with Option Strict Off - is its leniency as regards data typing and the general meaning of some keywords and programming structures. Examples: Dim, If...End If, With...End With, Select Case For Each...Next, etc. <> Since you don't give any examples, it's really not possible to give any advice or commiseration on this point. But having worked in VB.NET is no preparation for understanding any non-.NET Framework object model, especially an Office object model. Firstly, they build on COM programming principles and secondly, they revolve completely around the individual Office application and how it was designed. You first need to understand that - and that's just a lot of basic, grunt work. Doesn't matter which programming languages you're experienced in, even VBA, if you have little to no knowledge of Excel (or Word, or PowerPoint, or...) Perhaps if you were to detail what's bothering you, people could offer a bit more substantial assistance than telling you where to change settings in Tools/Options -:)?

                -- Cindy Meister

                1 Reply Last reply
                0
                • S Saul Johnson

                  Now before I start this rant, I mean no insult to any VBA programmers out there reading this. I could not have greater admiration for you for succeeding where I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code. I want to get the general consensus on this, as it has been bugging me no end. My first gripe is that the VBA programming environment that comes with Office (2007) is to my eyes just utter tat. It is currently removing and inserting random whitespace here there and everywhere in what seems to be an overtly malicious attempt to mess with my head. The 'intellisense' and 'syntax highlighting' leave much to be desired, but I could whine about that all day, so I'll stop there. In my opinion however, the absolute worst thing about the VBA editor that shipped with Excel 2007 is... The environment alerts you to coding errors with - get this - a MODAL messagebox that totally interrupts what you're trying to accomplish by screaming in your face until you click the stupid 'OK' button. Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel. So far this project, I have been repeatedly flummoxed by the arcane, esoteric knowledge of all the peculiarities of VBA that seems to be required to do anything at all in the language with any degree of efficiency. While I am far from being a VB guru, VB.NET is my main programming language alongside Java and also my main source of income. I was astonished to find that my half a decade of VB.NET experience did not help one jot with VBA. Is this just me? Please tell me, because I'm not sure if the problem is on my end (very possible) or with whichever dark ritual was used to create this 'programming language' in the first place.

                  A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.

                  D Offline
                  D Offline
                  DanielSheets
                  wrote on last edited by
                  #20

                  SixOfTheClock wrote:

                  whichever dark ritual was used to create this 'programming language'

                  Awesome!

                  1 Reply Last reply
                  0
                  • C CHill60

                    Ah VBA! I love it, love it, love it! Before you all dismiss me as completely and utterly mad, imagine the scenario ... 1. In the dark and distant past a user discovers Excel macros and starts to "automate" certain daily functions 2. It soon becomes all too much for them to handle so the macros get passed to an "IT contractor" to be brought up to production strength (an oxymoron if ever there was). Note that at this point the IT department still know nothing about this 3. In the meantime these spreadsheets somehow manage to become business critical "applications" 4. Eventually someone in the user department has an epiphany - or it might have been an audit finding - and said piece of s**t is passed over to the IT department to support. 5. By now the business-critical excel "application" consists of more than 120 spreadsheets mashed together like a web built by a hundred drunken spiders 6. Enter yours truly ... the re-engineering of various parts of this mess (when allowed to by the red-tape afficiandos) has kept me in gainful employment for some considerable time!! :-D p.s. around here "VBA" is known as "Visual Basic for Amateurs"

                    S Offline
                    S Offline
                    stmoore1
                    wrote on last edited by
                    #21

                    You forgot to mention that most of the macros are "written" using the "Record" button, not by actually hacking out code. My wife is in finance (and a formal auditor) and I cringe every time she shows me a spreadsheet that they're using to run the business. There's always a magical button that flashes through screens, changing pivot tables and spitting out charts, enough to be seizure inducing.

                    1 Reply Last reply
                    0
                    • L loctrice

                      The vba environment is vb6. The visual studio IDE for fb6 was exactly the same way. Horrible. Whenever possible, use .Net and/or Java to program for excel.

                      If it moves, compile it

                      F Offline
                      F Offline
                      Florin Jurcovici 0
                      wrote on last edited by
                      #22

                      loctrice wrote:

                      Horrible. Whenever possible, use .Net and/or Java to program for excel.

                      If it is possible to do your automation solution with OOo, I'd say give it a try. It's scriptable with both Python and Java, not just a VBA-like language (which it does allow, in order to be able to import MSO files containing macros).

                      L 1 Reply Last reply
                      0
                      • S Saul Johnson

                        Now before I start this rant, I mean no insult to any VBA programmers out there reading this. I could not have greater admiration for you for succeeding where I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code. I want to get the general consensus on this, as it has been bugging me no end. My first gripe is that the VBA programming environment that comes with Office (2007) is to my eyes just utter tat. It is currently removing and inserting random whitespace here there and everywhere in what seems to be an overtly malicious attempt to mess with my head. The 'intellisense' and 'syntax highlighting' leave much to be desired, but I could whine about that all day, so I'll stop there. In my opinion however, the absolute worst thing about the VBA editor that shipped with Excel 2007 is... The environment alerts you to coding errors with - get this - a MODAL messagebox that totally interrupts what you're trying to accomplish by screaming in your face until you click the stupid 'OK' button. Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel. So far this project, I have been repeatedly flummoxed by the arcane, esoteric knowledge of all the peculiarities of VBA that seems to be required to do anything at all in the language with any degree of efficiency. While I am far from being a VB guru, VB.NET is my main programming language alongside Java and also my main source of income. I was astonished to find that my half a decade of VB.NET experience did not help one jot with VBA. Is this just me? Please tell me, because I'm not sure if the problem is on my end (very possible) or with whichever dark ritual was used to create this 'programming language' in the first place.

                        A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.

                        J Offline
                        J Offline
                        John Atten
                        wrote on last edited by
                        #23

                        "

                        Quote:

                        I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code.

                        The first key problem here is the word "Excel" IMHO. VBA is most definitely showing its age (as is, of course, its parrent VB6). It is possible to build useful, workbale solutions for common business problems using VB6 and/or VBA outside of Excel, but using VBA in excel for anything other than custom functions for use WITHIN THE SPREADSHEET ITSELF is where things get really, really ugly. Back in the day, I found VBA to work fairly well within MS Access, and it also served as a great into learning environment. The very first time I attempted to apply my VBA "know-how" to an Excel spreadsheet, though, all that fell apart. Thankfully, I have moved beyond VBA/VB6 and into several other full-grown languages. But I would content that whatever issues are presented by VBA/VB6 are blown up by an order of magnitude when attempting to automate or code for an Excel spreadsheet.

                        1 Reply Last reply
                        0
                        • F Florin Jurcovici 0

                          loctrice wrote:

                          Horrible. Whenever possible, use .Net and/or Java to program for excel.

                          If it is possible to do your automation solution with OOo, I'd say give it a try. It's scriptable with both Python and Java, not just a VBA-like language (which it does allow, in order to be able to import MSO files containing macros).

                          L Offline
                          L Offline
                          loctrice
                          wrote on last edited by
                          #24

                          If I did it these days I most likely would use Libre. When I was doing the stuff before, it was required to use MS office. Not for reasons that made sense, but still required.

                          If it moves, compile it

                          1 Reply Last reply
                          0
                          • S Saul Johnson

                            Now before I start this rant, I mean no insult to any VBA programmers out there reading this. I could not have greater admiration for you for succeeding where I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code. I want to get the general consensus on this, as it has been bugging me no end. My first gripe is that the VBA programming environment that comes with Office (2007) is to my eyes just utter tat. It is currently removing and inserting random whitespace here there and everywhere in what seems to be an overtly malicious attempt to mess with my head. The 'intellisense' and 'syntax highlighting' leave much to be desired, but I could whine about that all day, so I'll stop there. In my opinion however, the absolute worst thing about the VBA editor that shipped with Excel 2007 is... The environment alerts you to coding errors with - get this - a MODAL messagebox that totally interrupts what you're trying to accomplish by screaming in your face until you click the stupid 'OK' button. Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel. So far this project, I have been repeatedly flummoxed by the arcane, esoteric knowledge of all the peculiarities of VBA that seems to be required to do anything at all in the language with any degree of efficiency. While I am far from being a VB guru, VB.NET is my main programming language alongside Java and also my main source of income. I was astonished to find that my half a decade of VB.NET experience did not help one jot with VBA. Is this just me? Please tell me, because I'm not sure if the problem is on my end (very possible) or with whichever dark ritual was used to create this 'programming language' in the first place.

                            A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.

                            K Offline
                            K Offline
                            Kent K
                            wrote on last edited by
                            #25

                            I think you just got off to a bad start and it'll gel for you. I've done VBA in excel (and some in Access) for years, mostly in Office 2003 though. I think it is great. The spreadsheet, when automated and a UI built up around it, is quite powerful in some business segments. You've already heard of the way to turn off the syntax check, yes, that is a huge pain when it is on. Programming in Excel with VBA has many of the same principles as VB.NET. . .you have objects (the workbook, each sheet, cells, forms you can create, msgboxes) that have the typical events you'd expect, just like .NET. Not sure why you have the intellisense problem, it's usually pretty good. "Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel." To this I'd say that the approach typically is to have a button on a worksheet to invoke a task or you make a UI form (window) with controls on it that do work, often using spreadsheets in the background as data stores where you can sort, filter, arrange, do mathematical functions upon, the data just as you would yourself when using a spreadsheet. Good luck!

                            1 Reply Last reply
                            0
                            • C CHill60

                              Ah VBA! I love it, love it, love it! Before you all dismiss me as completely and utterly mad, imagine the scenario ... 1. In the dark and distant past a user discovers Excel macros and starts to "automate" certain daily functions 2. It soon becomes all too much for them to handle so the macros get passed to an "IT contractor" to be brought up to production strength (an oxymoron if ever there was). Note that at this point the IT department still know nothing about this 3. In the meantime these spreadsheets somehow manage to become business critical "applications" 4. Eventually someone in the user department has an epiphany - or it might have been an audit finding - and said piece of s**t is passed over to the IT department to support. 5. By now the business-critical excel "application" consists of more than 120 spreadsheets mashed together like a web built by a hundred drunken spiders 6. Enter yours truly ... the re-engineering of various parts of this mess (when allowed to by the red-tape afficiandos) has kept me in gainful employment for some considerable time!! :-D p.s. around here "VBA" is known as "Visual Basic for Amateurs"

                              C Offline
                              C Offline
                              ClockMeister
                              wrote on last edited by
                              #26

                              CHill60 wrote:

                              Ah VBA! I love it, love it, love it!

                              LOL! Yeah, sometimes the technology that some people hate can be a gold mine. CB

                              1 Reply Last reply
                              0
                              • S Saul Johnson

                                Now before I start this rant, I mean no insult to any VBA programmers out there reading this. I could not have greater admiration for you for succeeding where I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code. I want to get the general consensus on this, as it has been bugging me no end. My first gripe is that the VBA programming environment that comes with Office (2007) is to my eyes just utter tat. It is currently removing and inserting random whitespace here there and everywhere in what seems to be an overtly malicious attempt to mess with my head. The 'intellisense' and 'syntax highlighting' leave much to be desired, but I could whine about that all day, so I'll stop there. In my opinion however, the absolute worst thing about the VBA editor that shipped with Excel 2007 is... The environment alerts you to coding errors with - get this - a MODAL messagebox that totally interrupts what you're trying to accomplish by screaming in your face until you click the stupid 'OK' button. Secondly it seems to be to be impossible, or at least highly impractical, to accomplish anything approaching an elegant solution to a problem using VBA in Excel. So far this project, I have been repeatedly flummoxed by the arcane, esoteric knowledge of all the peculiarities of VBA that seems to be required to do anything at all in the language with any degree of efficiency. While I am far from being a VB guru, VB.NET is my main programming language alongside Java and also my main source of income. I was astonished to find that my half a decade of VB.NET experience did not help one jot with VBA. Is this just me? Please tell me, because I'm not sure if the problem is on my end (very possible) or with whichever dark ritual was used to create this 'programming language' in the first place.

                                A programming language is to a programmer what a fine hat is to one who is fond of fancy garden parties. Just don't try wearing any .NET language on your head. Some of them are sharp.

                                R Offline
                                R Offline
                                RafagaX
                                wrote on last edited by
                                #27

                                Past success is not guarantee of future sucess... ;P As far as i'm aware, VB6 an VB.NET are different languages, just superficially similar on some syntax and features, so your knowledge on VB.NET is almost moot on VB6, probably the other way around could be better, but i won't be betting on it.

                                CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                                1 Reply Last reply
                                0
                                • C CHill60

                                  Ah VBA! I love it, love it, love it! Before you all dismiss me as completely and utterly mad, imagine the scenario ... 1. In the dark and distant past a user discovers Excel macros and starts to "automate" certain daily functions 2. It soon becomes all too much for them to handle so the macros get passed to an "IT contractor" to be brought up to production strength (an oxymoron if ever there was). Note that at this point the IT department still know nothing about this 3. In the meantime these spreadsheets somehow manage to become business critical "applications" 4. Eventually someone in the user department has an epiphany - or it might have been an audit finding - and said piece of s**t is passed over to the IT department to support. 5. By now the business-critical excel "application" consists of more than 120 spreadsheets mashed together like a web built by a hundred drunken spiders 6. Enter yours truly ... the re-engineering of various parts of this mess (when allowed to by the red-tape afficiandos) has kept me in gainful employment for some considerable time!! :-D p.s. around here "VBA" is known as "Visual Basic for Amateurs"

                                  O Offline
                                  O Offline
                                  OffCenter
                                  wrote on last edited by
                                  #28

                                  I have profited by the scenario you describe many times but regardless of how well you are being paid, maintaining those business critical Excel "applications" is often like playing Twister with a bunch of long unwashed dudes who reek of garlic and stale sweat. You have to run home for a long shower with the stereo blasting in an attempt to purge the memory of the experience from your body and soul.

                                  C M 2 Replies Last reply
                                  0
                                  • O OffCenter

                                    I have profited by the scenario you describe many times but regardless of how well you are being paid, maintaining those business critical Excel "applications" is often like playing Twister with a bunch of long unwashed dudes who reek of garlic and stale sweat. You have to run home for a long shower with the stereo blasting in an attempt to purge the memory of the experience from your body and soul.

                                    C Offline
                                    C Offline
                                    CHill60
                                    wrote on last edited by
                                    #29

                                    ROTFLMAO! So true my friend, so true.

                                    1 Reply Last reply
                                    0
                                    • L Lost User

                                      loctrice wrote:

                                      program for excel.

                                      Still horrible.

                                      M Offline
                                      M Offline
                                      Member 4608898
                                      wrote on last edited by
                                      #30

                                      I normally use vbscript - probably more archaic than VB6 but the great thing is you can copy stuff from odbc databases to create word, excel and powerpoint documents. If you get fed up of vbscript, you can use javascript to achieve the same result.

                                      1 Reply Last reply
                                      0
                                      • O OffCenter

                                        I have profited by the scenario you describe many times but regardless of how well you are being paid, maintaining those business critical Excel "applications" is often like playing Twister with a bunch of long unwashed dudes who reek of garlic and stale sweat. You have to run home for a long shower with the stereo blasting in an attempt to purge the memory of the experience from your body and soul.

                                        M Offline
                                        M Offline
                                        Member 4608898
                                        wrote on last edited by
                                        #31

                                        Most janitorial jobs are like that. If it doesn't work, blame the guy before (crap coding, not well thought out, doesn't know what he/she's doing etc). If it does work, you get the credit. You won't find any other job with a win-win situation. Remember the moral of the story of the non-conforming sparrow - when you are warm and happy in a pile of shit, keep your mouth shut.

                                        1 Reply Last reply
                                        0
                                        • C CHill60

                                          Ah VBA! I love it, love it, love it! Before you all dismiss me as completely and utterly mad, imagine the scenario ... 1. In the dark and distant past a user discovers Excel macros and starts to "automate" certain daily functions 2. It soon becomes all too much for them to handle so the macros get passed to an "IT contractor" to be brought up to production strength (an oxymoron if ever there was). Note that at this point the IT department still know nothing about this 3. In the meantime these spreadsheets somehow manage to become business critical "applications" 4. Eventually someone in the user department has an epiphany - or it might have been an audit finding - and said piece of s**t is passed over to the IT department to support. 5. By now the business-critical excel "application" consists of more than 120 spreadsheets mashed together like a web built by a hundred drunken spiders 6. Enter yours truly ... the re-engineering of various parts of this mess (when allowed to by the red-tape afficiandos) has kept me in gainful employment for some considerable time!! :-D p.s. around here "VBA" is known as "Visual Basic for Amateurs"

                                          E Offline
                                          E Offline
                                          Earl Truss
                                          wrote on last edited by
                                          #32

                                          I've lived through this "process" too over the past 16 years. It will keep me in productive employment for the remaining years (both of them) until I retire. I'm currently maintaining an Access database front-end for a SQL Server 2012 database which uses a large amount of VBA code that is used to run the whole business. Having written applications in VB6 for 12 years before this job means that I'm used to the whole thing.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups