Hi Corinna, I apoligize, I had another huge project come up and hadn't had a chance to experiment with this yet. Thank you very much for providing your expertise!
Have a great week! --------------------------------------- Heather Castillo Module Coordinator/HPMIN Support Information Systems 785.623.5084 HaysMedicalCenter [EMAIL PROTECTED] (mailto:[EMAIL PROTECTED]) __________________________________________________ >From Corinna M. Robertson <[EMAIL PROTECTED]> Sent Fri 2/15/2008 2:37 PM To [email protected] Cc 'Corinna M. Robertson' <[EMAIL PROTECTED]> Subject RE: [Talk] Row Count I’ll skip the using of the excel object as I see someone already responded with that solution. Using the DataStation and adding a few lines of code here is the solution: First in Visual Basic add a reference to the Excel object using Tools|References from the menu. Then in the Visual Basic Code you will declare a variable as a worksheet and set it to the DataStation’s open file. Dim sh1 as New WorkSheet (I do this at the top of the module) Set sh1 = D.t.appl.Workbooks(1).Worksheets("Sheet1") Once done you know have full access to the underlying Excel objects and can now use the following to get the record count. X = sh1.UsedRange.Rows.Count From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thom C. Blackwell Sent: Friday, February 15, 2008 11:14 AM To: [email protected] Cc: 'Corinna M. Robertson' Subject: RE: [Talk] Row Count Greetings, Unfortunately, there’s not a property that does this since the DataStation accesses the file “line by line”. An “after the fact count” can be obtained using: F(“RC”)=d.record d.record tells you the current record it is reading. If this is put in a strategic place in your script, it will keep “incrementing” as the script progresses, and when it reaches the end of the file, F(“RC”) would be equal to the last record in the file, which would also be the total number of records. Since you’re using Excel ,there <may> be an “backdoor” here. I’ve cc’d a resident expert here that may know this. 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 up for my weekly webinar! (http://www.bostonworkstation.com/customer_center/special_events.aspx) 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Heather Castillo Sent: Friday, February 15, 2008 10:50 AM To: [email protected] Subject: [Talk] Row Count Anyone happen to know a simple object/function to count the number of rows in an excel spreadsheet from the datastation and return that as a variable? I think I am making this way more difficult than it needs to be.... Thanks! --------------------------------------- Heather Castillo Module Coordinator/HPMIN Support Information Systems 785.623.5084 HaysMedicalCenter [EMAIL PROTECTED] (mailto:[EMAIL PROTECTED])
Important: This email and any attachments may contain confidential information subject to protection under the Federal Standards for Privacy of Individually Identifiable Health Information (45 C.F.R. Parts 160 and 164). If you or your organization is a “Covered Entity” under the above mentioned regulations, you are obligated to treat such information in a manner consistent with the regulations. If it appears that this email was sent to you in error, (1) you are prohibited from utilizing or disseminating this email or any attachments; (2) please immediately delete it from your computer and any servers or other locations where it might be stored, and email this sender or call the Hays Medical Center Privacy Officer at (785) 623-2188 advising that you have done so. We appreciate your cooperation.
