Greetings, Mitch and I exchanged some further emails-figured Id respond to the group what is going on
Heres the problem. When VB runs a sub routine, it does a quick syntax check of that routine. Since the Common module has not been loaded, there is no such sub routine as PopupScreen in the project, so VB will rightfully generate a Sub or Function Not Found error. There is not a way to do an Include in VB (well at least I dont know how and Ive asked folks who would know) - where you just say hey- I am going to call a sub routine yeah its not here now, but Im going to get it from here so VB, its ok chill out So this importing stuff is not <exactly> the answer you are looking for. Heres my suggestion The importing is useful if you are going to be modifying the common module and want those changes to automatically update across multiple projects (so a common login routine for example and you need to change menu options etc. But You will have to have import the module when you start development in the new project (which youd need to do anyhow for building /testing your script). If every single script you are ever going to create will need this code(or most will anyhow) you could create yourself a shell project that has the code you want in it. Put the LoadScript routine in its own module, and have the Common.bas in there as well. Then save this project as Default.BWS in c:\bss70. Then rename it using windows explorer to Default.BWD and voila every new project you build will have this code. It will still be up to the script to call LoadScript Regards, Thom Thom C. Blackwell Product Manager Boston Software Systems (866) 653-5105 ex 807 www.bossoft.com <http://www.bossoft.com/> Visit us in Booth 2471 at HIMSS08 - February 25-28 in Orlando, FL Sign <http://www.bostonworkstation.com/customer_center/special_events.aspx> up for my weekly webinar! LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately, then delete this message and empty from your trash. From: Lawrence, Mitchell [mailto:[EMAIL PROTECTED] Sent: Thursday, January 31, 2008 11:42 AM To: Thom C. Blackwell Subject: RE: LoadScript Routine Here is what I have right now. Common.bas is located in C:\ Thank you, Mitch Lawrence Lead Applications Analyst Technical Support - NPR/Automation CHRISTUS Information Management : <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] Send a " <http://intranet.christushealth.org/spiritBuck/Default.asp> thank you" to someone! _____ From: Thom C. Blackwell [mailto:[EMAIL PROTECTED] Sent: Thursday, January 31, 2008 10:38 AM To: Lawrence, Mitchell Subject: LoadScript Routine Greetings, Does your project have this code in the scripts module? Im going to lobby for this to be a command btw because now each project that needs to load the common module also needs to have this code (which would not be in c:\ Common.bas) Regards, Thom Sub loadScripts() Dim p As Object Set p = Share("VBProject").VBE.VBProjects(1) 'Remove old code myimport = "Common" For i = 1 To p.VBComponents.Count If InStr(p.VBComponents.Item(i).Name, myimport) Then p.VBComponents.Item(i).Name = "temp" p.VBComponents.Remove p.VBComponents.Item(i) Share("VBProject").VBE.CommandBars("Standard").Controls(3).Execute End If Next i p.VBComponents.Import "c:\Common.bas" Share("VBProject").VBE.CommandBars("Standard").Controls(3).Execute End Sub Thom C. Blackwell Product Manager Boston Software Systems (866) 653-5105 ex 807 www.bossoft.com <http://www.bossoft.com/> Visit us in Booth 2471 at HIMSS08 - February 25-28 in Orlando, FL Sign <http://www.bostonworkstation.com/customer_center/special_events.aspx> up for my weekly webinar! LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately, then delete this message and empty from your trash.
<<image001.jpg>>
