• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

VBA and Excel

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    VBA and Excel

    An organisation I give some general IT advice to has asked me a quite a complex question (complex to me)...

    They have a spreadsheet that lists equipment they issue to clients. Each item of equipment has its own line in the spreadsheet. What they would like to happen is the following.

    If a particular cell is changed can an email be generated that is auto populated with information from the same line?

    E.G. A piece of equipment has its status changed from "Available" to "Issued" VBA jumps in and presents an email addressed to stores with the subject containing the serial number and name of the item (Taken from cells in the document) and the body of the asking for address info.

    I'm not asking for the solution to be posted, just yes/no its possible,and possibly a link to somewhere that can give more info.

    I know there are better solutions (SharePoint etc) but excel is the only option available at the moment...
    Last edited by Netraider; 14 December 2011, 22:12. Reason: Noddy spelling mistakes
    SUFTUM

    May life give you what you need, rather than what you want....

    #2
    Yes assuming outlook is sat on the machine and you don't mind the email coming from the person updating the spreadsheet.
    merely at clientco for the entertainment

    Comment


      #3
      Originally posted by eek View Post
      Yes assuming outlook is sat on the machine and you don't mind the email coming from the person updating the spreadsheet.
      That is what I was hoping would happen... Is this something quite simple, or am I looking at squeezing big bucks out of this organisation?
      SUFTUM

      May life give you what you need, rather than what you want....

      Comment


        #4
        It can certainly be done. You'll need to catch an event that will be generated when the cell in question is changed, munge the cells you need into some strings and invoke outlook to send the mail, which should be easy enough, I've used excel to drive other applications and called it "test automation" before.

        Running VBA Code When Events Occur in Excel 2010 will get you started with events.
        While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

        Comment


          #5
          Originally posted by Netraider View Post
          That is what I was hoping would happen... Is this something quite simple, or am I looking at squeezing big bucks out of this organisation?
          A google search or two will give you most of the core code you need.

          You still need to modify it, test it, deploy it and then test it again in situ. so its probably 3 days work especially as everything in office is version dependant.
          merely at clientco for the entertainment

          Comment


            #6
            Originally posted by Netraider View Post
            An organisation I give some general IT advice to has asked me a quite a complex question (complex to me)...

            They have a spreadsheet that lists equipment they issue to clients. Each item of equipment has its own line in the spreadsheet. What they would like to happen is the following.
            Why do people insist on using the wrong tools for the job?


            Spreadsheets are great and certainly versatile. However in this situation, an access database would be far better. In there you can do everything you want, lay out forms for each record, make a switchboard so editing and adding equipment is very easy, etc etc.

            Access is a far better tool for this job and part of the MS office suite.

            Comment


              #7
              Originally posted by wim121 View Post
              Why do people insist on using the wrong tools for the job?

              Well said! Drives me mad...

              Comment


                #8
                Originally posted by eek View Post
                Yes assuming outlook is sat on the machine and you don't mind the email coming from the person updating the spreadsheet.
                You can also use CDO instead of the MAPI object model & Outlook client. It's much more flexible than Extended MAPI and you can set the name of the Sender which doesn't have to be the person who's actually logged on. Can be a pain to set up though getting the schemas right.

                Comment


                  #9
                  Originally posted by wim121 View Post
                  Why do people insist on using the wrong tools for the job?


                  Spreadsheets are great and certainly versatile. However in this situation, an access database would be far better. In there you can do everything you want, lay out forms for each record, make a switchboard so editing and adding equipment is very easy, etc etc.

                  Access is a far better tool for this job and part of the MS office suite.
                  Ofthe the reason is down to Access being included in Office Pro rather than Office Std and so does not tend to get deployed as often. Also there tends to be fewer people kicking about who can make a database than can throw together a spreadsheet. I've worked at loads of places where they have struggled to implement database functionality into a spreadsheet but simply will not accept a database! On the plus side it gives ample opportunity to keep on generating invoices! Grin and bank it!

                  it is possible to do and not difficult. I also would side with the Access solution as things can become a mess in Excel very easily!
                  Rule Number 1 - Assuming that you have a valid contract in place always try to get your poo onto your timesheet, provided that the timesheet is valid for your current contract and covers the period of time that you are billing for.

                  I preferred version 1!

                  Comment


                    #10
                    There is a large section of GE which prior to be bought ran on a set of interlinked Lotus 123 spreadsheets.

                    I remember my colleagues having serious fun trying to audit the location of assets.
                    merely at clientco for the entertainment

                    Comment

                    Working...
                    X