Here is my standard subroutine for loading an excel worksheet. With
apologies to real programmers, this routine uses public variables because
of the way my dictionary scripts are structured:
Sub subExcelLoad()
Set oExcel = CreateObject("Excel.Application")
'see cmdOk
Set oBook = oExcel.Workbooks.Open(stroBook)
Set oSheet = oBook.Worksheets(stroSheet)
oSheet.Activate
oExcel.Visible = True
intRow = 1 'This is the first row of data
strCell = "A" & intRow
oSheet.range(strCell).Select
End Sub
So the public variable stroBook could be created as:
intStartSeq = 5
intEndSeq = 10
For intExcelCounter = intStartSeq to intEndSeq
stroBook = "Book" & str(intExcelCounter )
subExcelLoad
Next
Or something similar. Don't forget to give the variable stroSheet a value.
It is case sensitve.
intRow is the starting row.
Hope this helps,
John
John Curtiss
Hutchinson Area Health Care
1095 Highway 15 South
Hutchinson MN 55350
320-234-4967
[EMAIL PROTECTED]
"Lew Hundley"
<[EMAIL PROTECTED] To: [EMAIL PROTECTED]
> cc:
Sent by: Subject: [Talk] Help! - CRUNCH
TIME
[EMAIL PROTECTED]
TATION.COM
09/23/2003 04:37 PM
Please respond to Talk
Hey guys, little help over here?
I have been asked to come up with a quick script that would allow the
printing of Excel docs with sequential numbers. I have been working on
this since mid morning.
I researched for a way to do it in EXCEL alone, but was unsuccessful in
finding a way.
My solution:
A script that will supply the starting number, the print the Excel doc
using this number, then the script will increment the number, and print the
Excel doc, etc, etc.
The issues are that I cannot find anyway to pass a parameter to Excel; it
doesn't have that type of argument.
So I went to an alternate. I created a Word doc, and put the starting
number in there, then, through Excel, I linked the number as an object.
Manually, I can get the number to change EXECEPT if I delete the number, I
cannot manually type in any numbers between the object brackets. I have to
start at the next to last digit, enter a the next sequential digit, then
delete the last digit. And I don't know that I can do that fine a tuning
with BWS yet.
Yes, this is just a sequentially numbered spreadsheet that is being printed
to take an inventory. The sequential numbers are currently being hand
stamped (very slowly).
I need this in about an hour and a half from the time of this writing.
Has any one produced such a thing (via BWS or otherwise). (I have to say
that I have had a hard time 'learning' how to deal with a windows
application and BWS; I have only worked with the Meditech stuff in the
past, and I am trying to Shell the Excel app, and write to the Word app,
and print the Excel sheet).
All suggestions except "what are you, nuts?" accepted.
TKs
Lew Hundley
Information Specialist - Programmer
Silverton Hospital
Silverton Oregon
503.873.1657
[EMAIL PROTECTED]