Sharing script among network users

G

gumbah5

Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Hi,

I have a script that does the following:

1) Opens a pre-made excel workbook (BVHigh.xls)
2) prompts the user to input data through two input prompt boxes (name and grade level for ten students) which then populates the ten sheets of the workbook
3) Renames the tabs of the appropriate sheets

How do I enable the script to be shared among other users over the network? I've included the script and the excel workbook in a folder on our network attached storage device but when I test it from another computer, it simply opens a new workbook rather than the one specified.

Here is the beginning of the script:

tell application "Microsoft Excel"
try
activate
open workbook workbook file name "BVHigh.xls"
activate object worksheet "names"

set myrange to range "A2" of worksheet "names"
set myname to input box prompt "Please type a Student Name title "Students"
set value of myrange to myname
set name of sheet 3 to myname
set myrange to range "B2" of worksheet "names"
set myname to input box prompt "What grade level is this student?" title "Grade Level?"
set value of myrange to myname

This works well on the machine on which it was created (Mac Book Pro- 10.6.2)

Surely I must be missing something! We have mostly eMacs running 10.5.8 and all are running Office 2008.

I could just provide the excel workbook on its own and have the teachers do more on their own but I'd really like to showcase the abilities of Applescript!

Any ideas/suggestions/help will be greatly appreciated!

I also would like to "save as" the workbook based on other data that is provided by the user (from a cell value) but am mainly interested in resolving the sharing protocol which I am clearly missing.

Thanks in advance!
 
B

Bob Greenblatt

Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel
Hi,

I have a script that does the following:

1) Opens a pre-made excel workbook (BVHigh.xls)
2) prompts the user to input data through two input prompt boxes (name and
grade level for ten students) which then populates the ten sheets of the
workbook
3) Renames the tabs of the appropriate sheets

How do I enable the script to be shared among other users over the network?
I've included the script and the excel workbook in a folder on our network
attached storage device but when I test it from another computer, it simply
opens a new workbook rather than the one specified.

Here is the beginning of the script:

tell application "Microsoft Excel"
try
activate
open workbook workbook file name "BVHigh.xls"
activate object worksheet "names"

set myrange to range "A2" of worksheet "names"
set myname to input box prompt "Please type a Student Name title "Students"
set value of myrange to myname
set name of sheet 3 to myname
set myrange to range "B2" of worksheet "names"
set myname to input box prompt "What grade level is this student?" title
"Grade Level?"
set value of myrange to myname

This works well on the machine on which it was created (Mac Book Pro- 10.6.2)

Surely I must be missing something! We have mostly eMacs running 10.5.8 and
all are running Office 2008.

I could just provide the excel workbook on its own and have the teachers do
more on their own but I'd really like to showcase the abilities of
Applescript!

Any ideas/suggestions/help will be greatly appreciated!

I also would like to "save as" the workbook based on other data that is
provided by the user (from a cell value) but am mainly interested in resolving
the sharing protocol which I am clearly missing.

Thanks in advance!
The flaw I see in the above script is that Excel looks in the current
directory for the file if only the file name is specified. Since this is a
user¹s machine, your script has no idea what directory that may be or what
the user may have done before the script runs. So, use the fully qualified
name of the workbook. That is, the full path to the workbook as seen on the
network from the other computers. Do the same for the file name in the Save
as.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top