• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem with a simple Excel 2004 script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with a simple Excel 2004 script


  • Subject: Re: Problem with a simple Excel 2004 script
  • From: Don Fuller <email@hidden>
  • Date: Thu, 30 Aug 2007 21:42:36 -0500


On Aug 30, 2007, at 8:41 PM, Don Fuller wrote:

I have been pounding my head over this one for a couple of weeks. I've been playing with it a few minutes a day. I am simply trying to drop an .xls file on my script and have it save the dropped script in the same directory as the original as a .csv file. Sounds simple right? Well this script works the first time around, sort of. It will do exactly that, except the resulting .csv file is empty. If I run it again, it tells me that 'active workbook' doesn't understand the 'save' command. I don't understand… Can someone help?

Here is the script:

on open fileList
repeat with aFile in fileList
set aFile to (aFile)
tell application "Microsoft Excel"
open aFile
save ActiveWorkbook in (aFile & ".csv") as CSV
end tell
end repeat
end open


Thanks in advance.

Found a solution to the now quite obvious errors here.

Here it is:

--begin script
on open fileList
repeat with nextFile in fileList
tell application "Microsoft Excel"
open nextFile
set outFile to ((nextFile as text) & ".csv")
save the active workbook in outFile as CSV
end tell
end repeat
end open
-- end script

Thanks to Jolly Roger on comp.sys.lang.applescript
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Problem with a simple Excel 2004 script (From: Don Fuller <email@hidden>)

  • Prev by Date: Re: XML - System Events vs XMLlib
  • Next by Date: Re: XML - System Events vs XMLlib
  • Previous by thread: Problem with a simple Excel 2004 script
  • Next by thread: Catch click on dock icon ?
  • Index(es):
    • Date
    • Thread