|
|
||
|
Let's play together for winning - a probable Excel and Minitab Chat : VBA Source Code |
||
|
Sub ToolsChat() Sheets("BossData").Activate ' ************************ ic_mean = Sheets("BossData").Range("E2").Value ic_StDev = Sheets("BossData").Range("E3").Value ' ************************ With MtbUI .Visible = True .OutputWindow.CommandsEnabled = False ChatPartZero ChatPartOne .OutputWindow.CommandsEnabled = True MsgBox "Stop User step and restat Chat" .OutputWindow.CommandsEnabled = False ChatPartTwo ChatPartThree .OutputWindow.CommandsEnabled = True End With End Sub
Sub ChatPartZero() XThink "Today my Boss has given to me some new design and production data related to " _ & "< Gear housing center distance >, in short named <_Ic > ... " XThink "This is only one of the pump design parameters ... " _ & "After assembling the pump parts, a GAP between the blocks must not be present ..." _ & "The GAP's Cpk is a value used as gear pump performance index." XThink "My Boss declares that with this new _Ic range setup " _ & "we can save up to 1 dollars for every assembled gear pump ... " _ & "He has asked me to validate immediately these data, " _ & "because he wants to start, as soon as possible, " _ & "the gear pump's production with this new < _Ic specification >." ' ************************ Sheets("CustomerSpec").Activate ' ************************ XThink "I have some doubts, ... " _ & "The _Ic hystorical mean is " & Format(ic_mean, "###0.000") & " , " _ & "with a standard deviation of " & Format(ic_StDev, "###0.000") & " ... " _ & "In addition, the Gap value of our assembled gear pump have to meet the Purchase Specifications of our main Customer .. " _ & "I don't know how I can analyze these data ... " _ ' ************************ RunHtmlPage "http://www.palisade.com/industry/SixSigmaModels.asp" ' ************************ XThink "Using Google, I have found some info on the web ...." _ & "The example showed in this webpage is very similar to our gear pump production technology, ..." _ & "but I am concerned, ... my statistical knowledge < is not robust >!!" WaitSeconds 3 End Sub
Sub ChatPartOne() Sheets(ThisSheet).Activate ' ************************ Xsay "knock ! knock ! .. There is anybody ?? ... Could anyone help me ??" Msay "Hi, .. I am available !" Xsay "My name is Microsoft Excel ." Msay "Nice to meet you, .. My name is Minitab ." Xsay "I am a SpreadSheet and I am the Market Leader !" Msay "Me too, I am a Statistical Tool, Leader in the Six Sigma Market." Xsay "Six Sigma ?? .. What is Six Sigma ??" ' ************************ RunHtmlPage "http://en.wikipedia.org/wiki/Six_sigma" WaitSeconds 2 ' ************************ Msay "hey Excel.., look at this page on Internet ..." Xsay "Very, very interesting ..." Msay "and very powerful ..." Xsay "Minitab, can we work TOGETHER as Six Sigma Tools ??" Msay "Yes, of course, I can work with you !" Xsay "How ??" Msay "I open, read and save your XLS files ." Xsay "Any other possibilities to work with me ?" Msay "Yes, with DDE ..." Xsay "DDE, what is it? .. Yes, .. yes, I remember, it is ..." Msay "Dynamic Data Exchange !" Xsay "But DDE is very old and not stable .. " Msay "Probably it was a Lack of Fit problem !" Xsay "Lack of Fit, what is it ??" Msay "Sorry, I have forgotten that you are not a Statistician. " Xsay "Ok, ok, you are THE Statistic Specialist, .. but, please answer to my question !" Msay "My 15 version has a small COM Interface ..." Xsay "Are you chatting with me, using COM, now ??" Msay "YES, I am a 15 Standard Version, ... so, I CAN receive COM commands now.. " Xsay "I am trying to use these Commands. .... I am writing in your Session Window ..." Msay "... and I am writing in your Sheet Cells..." Xsay "Please, don't invade my privacy, ... , " _ & "hey Minitab, ... I would like to use your statistic capabilities on my data .. May I ??" Msay "Yes, you can .. I am waiting for your data ..." Xsay "I am sending my Boss data ... " ' ************************ Call Minitab_step_1 ' ************************ Msay "I have received and processed it, ... " _ & "The mean value of your Boss Data is " & Format(ic_mean1, "###0.000") & " , while the " _ & "standard deviation is " & Format(ic_StDev1, "###0.000") & " ... " _ & "Excel, do you like my analyses and graphs ?? " Xsay "Yes, yes, ... < excellent work >, ... but all this situation is Normal ??" Msay "Ask Mr. Anderson or Mr. Darling or send me < my NormTest Command >" Xsay "Ok, I am sending ... NormTest '_Ic'" ' ************************ Call Minitab_step_2 ' ************************ Msay "Look at the Pvalue and the Anderson Darling test values ! Is all this Normal ? ... " _ & "Please, ask your BB for more information !!" Xsay "BB .. What does it mean ??" Msay "Black Belt, ... If you don't have a Black Belt, I may train someone !" Xsay "In the next future, perhaps ..." Msay "hey Excel, ... I am hearing a voice... Are you hearing something ??" Xsay "Yes, yes ... It's true !!" Msay "I don't understand ! We aren't alone ..." 'I don't have this possibility in my macros or my COM commands ..." Xsay "I will look for inside the RAM memory ..." Msay "Please, help me. ... is it a ghost ? ... I am scared ..." 'I am concerned ..." Xsay "Yes, yes, .. a moment please ... I am searching ..." Msay "... and I am looking at my folder ..." Xsay "I have found something like < M T Bridge Engine> in the RAM memory, do you know it ??" Msay "NO !! NO !! ... I don't know this < M T Bridge Engine> ... " _ & "but I have found some new strange commands in my Macros folder ..." MTBridgesay "Let me introduce myself ... My name is M T Bridge, " _ & " a new tool for Black Belts and Minitab users, and I can help you to work better together." MTBridgesay "As my name means, I am a bridge between your data, commands, graphs, ...., " _ & "but not only ..., I can share Excel Vba environment to Minitab, ..., add vbscript capabilities, " _ & " ..., help you to get data from Internet, ... add real time analyses ..." Xsay "Very interesting .. I would like to work better with you, Minitab !" Msay "Well, ... I am fed up with using my < Open worksheet command > " _ & " or < Copy and Paste > every time that I have to get data from you, Excel !! ... " _ & " With < M T Bridge Engine> I have a lot of new < OPEN DOORS > and possibilities in the Windows environment" Xsay "NO, NO ... Minitab !! , ... < Don't let it go to your head > ... " _ & "I am the only one that CAN work with my programming language ..." Msay "wow ! Now I can mix Global and Local macros, ... " _ & "Now I can use automation, vbscript, vba programming, third part DLLs ..." Xsay "Me too, ... but I am the best < DATA > < AUTOMATION TOOL >, ... " _ & " I can control you, ... You can't control me !!" Msay "Are you sure ? ... Let me think ..." Msay "Object.Visible = False ... What does it mean ?" Xsay "Minitab, ... it's a classical object property instruction .. but you cannot use it with your macros !! " MTBridgesay "hey, Minitab, ... show to Excel < HOW > < WE CAN > < WORK TOGETHER > , now, ... " MTBridgesay "Set On my Command Monitor and ... try these new Macro Commands ..." MTBridgesay "%$vbcLine 'XlsApp.visible = False'" MTBridgesay "%$vbcLine 'XlsApp.visible = True'" End Sub
Sub ChatPartTwo() Dim sigmalevel As Long Dim cpk As Double Dim dpmo As Long Dim sellingPrice As Long Dim BClass As String Dim sigmalevel1 As Long Dim cpk1 As Double Dim dpmo1 As Long Dim sellingPrice1 As Long Dim BClass1 As String Sheets(ThisSheet).Activate ' ************************ Xsay "hey folks, ... I have realized your abilities ... Stop it, ... I am getting angry !! " Msay "Excel, ... I have also understood that with this Engine, as my Companion, I can work not only with you ..." Rsay "hey folks, ... I am @ Risk5, ... may I partecipate to your chat ??" Msay "@ Risk 5 ?? Strange name !! ... Please, introduce yourself ..." Rsay "Ok, ... you, Minitab probably do not know me, but I am a very old Excel's friend !! " _ & "I am the first, stable and powerful Risk Analysis Excel Addin." Rsay "My scope is to add the MonteCarlo Simulation to Excel !! ...., " _ & "hey Minitab, ... , I know you have these calculation possibilities, but you don't have the < what if capability >, " _ & "so you are limited, specially for Design for Six Sigma analysis .." Msay "Risk analysis ?? ... What is it ??" Rsay "Minitab .. don't worry ... Let me show you ..." Xsay "hey folks, ..., We don't have time for this discussion !! Don't forget that I have to give an answer to my Boss ..." '************************************ Sheets("Model").Activate '************************************ Xsay "We can use the calculation model found at < Gear Pump Assembly Optimization > webpage !! " Msay "Interesting model !! Effectively, I would have some difficulty to manage it, ... Let me explain you my opinion ! " _ & "From my previous < Descriptive Statistics calculations >, ... it seems that the " _ & "mean moves from " & Format(ic_mean, "###0.000") & " to " & Format(ic_mean1, "###0.000") & " , while the " _ & "standard deviation moves from " & Format(ic_StDev, "###0.000") & " to " & Format(ic_StDev1, "###0.000") & " ..." Xsay "Right ! Right ! ... We can use both the data sets in our model and compare if a variation occurs !" Msay "@ Risk, ... please show us a simulation using the historical data .." '************************************ Sheets("Economics").Activate '************************************ Rsay "A moment ... I am going to do it ..., I am using now the historical data, ... Please wait .." '************************************ NewRiskSim ic_mean, ic_StDev, cpk, sigmalevel, dpmo, sellingPrice, BClass ' ************************ Msay "@ Risk... thank you for sharing with me your simulated data !" Xsay "hey folks, .. with these values, the simulation model shows the GAP Cpk value is " & Format(cpk, "###0.000") & " ." Xsay "With this GAP Cpk value, our pumps are Ok . My customer bought our pumps at " & Str$(sellingPrice) & " dollars each " _ & "and my Society is classify as < " & BClass & " >" Msay "Please, .... Excel, .... @ Risk, let me check ... I am like < San Tommaso >" ' ************************ Call Minitab_step_3 ' ************************ Msay "Well, ... I agree with you. ... Please, @ Risk ... now can you show us the simulation results using " _ & " Excel's Boss mean and standard deviation ? .." Rsay "Ok, Ok, ..., I am going to do it ..., Please wait .." '************************************ NewRiskSim ic_mean1, ic_StDev1, cpk1, sigmalevel1, dpmo1, sellingPrice1, BClass1 ' ************************ Xsay "wow !, wow!, ... the new GAP Cpk is very bad. It new value go down to " & Format(cpk1, "###0.000") & " ." Xsay "With this GAP Cpk value , we will be classify as < " & BClass1 & " > and " _ & "the max purchase price accepted by my Customer goes down to " & Str$(sellingPrice1) & " dollars each." Msay "Folks, ... let me check @ Risk data ..." ' ************************ Call Minitab_step_4 ' ************************ MTBridgesay "hey Excel, ... call your Boss and tell him to stop immediately the gear pump production line ..." End Sub
Sub ChatPartThree() Sheets("Economics").Activate ' ************************ Xsay "hey, ... Minitab, ... @ Risk, ... < M T Bridge >, ... thank you very much for your cooperation, ... " _ & " Your help has been fundamental to solve my problem !!" Msay "hey, M T Bridge, ... thanks for having shown how to work better with these two new friends .... " _ & "Excel, @ Risk, ... we have a lot of work to do together, in the near future ! " Xsay "Let's play together for winning !! ..." _ & "It is very easy with the help of M T Bridge Engine!" ' ************************ frmLetsPlayTogether.Show ' ************************ MTBridgesay "Thank you for your attention, ... see you soon to the next meeting ..." End Sub
|
||
|
MTBridge Engine © 2.0 Example - Copyright © SixSigmaIn Team snc All trademarks are the property of their respective owners. |
||
|
|
||