Use application on another computer

I have created an XCODE project, that sends data to Excel from an app on 1 mac to Excel on another mac… It works fine from a mac that has Excel loaded on it, but it will not run a mac that it isn’t loaded on. It asks me to locate Excel… I can’t figure out how to fix this. Here is the part of the script that is telling it to use Excel on the mac it is loaded on (BaseMac)

try
tell application “Excel” of machine BaseMac
using terms from application “Microsoft Excel”
Activate
tell Worksheet 1
set CurrentCell to ((“R1” as string) & ExcelRange2) as string

Thanks

Moving to AppleScript Studio and Xcode…

Um, shouldn’t “Excel” in the second line be “Microsoft Excel”? Maybe I’m missing something, but it looks like a typo.

If it’s not a typo, I’d start troubleshooting here. It’s not possible to use terms from an application that the computer doesn’t have on it.

It is not a typo. If I change the code to read Microsoft Excel, the program no longer works even with a Mac with Excel on it.

At least I know where to start, even though I haveno clue how I am going to solve the issue yet. Thanks

It’s also a typo :wink:
Sending Remote Apple Events is a bit tricky.
You can’t open applications directly, you must open them by the application file id (which is actually the bundle identifier)

tell application "Finder" of machine BaseMac
	using terms from application "Finder"
		if "Microsoft Excel" is not in (get name of processes) then open application file id "com.microsoft.Excel"
		repeat until "Microsoft Excel" is in (get name of every process)
			delay 1
		end repeat
	end using terms from
end tell
try
	using terms from application "Microsoft Excel"
		tell application "Microsoft Excel" of machine BaseMac
			activate
			tell worksheet 1
				set CurrentCell to (("R1" as string) & ExcelRange2) as string
			end tell
.

Note: You have to use the Finder to open the application, because it runs reliably, System Events doesn’t

Thank you, I had to change 2 line of the code to get it to build without error:

swapped the lines around
tell application “Microsoft Excel” of machine BaseMac
using terms from application “Microsoft Excel”

However, I still have the same problem. The little app that this code is associated with, will launch fine on another mac, but when
I go to send the data to the receiving mac with Excel on it, it still asks me to locate my copy of Excel…

It appears that the only solution is to load Excel on all the machines that are to use this program, for the ones that do have Excel on them the app works fine.