• 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: Import txt file in Excel and set cell options
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Import txt file in Excel and set cell options


  • Subject: RE: Import txt file in Excel and set cell options
  • From: email@hidden
  • Date: Wed, 18 May 2011 14:00:51 +0000
  • Sensitivity: Normal

> Who can help me with this:

> -- Working on a Applescript to open txt files in Excel.
> tell application "Microsoft Excel" -- version 12.0.0
> 	open {file (item i of my_TXT_Files as string)} -- so far so good
> 	-- How do I tell Excel to format all imported data/cells as text
> (e.g. instead of general)? Just like I could do when I import a txt
> file in Excel by hand (step 3 of the import wizard).
> end tell

> Thaks in advance for any help.
> Bert.

Hi Bert,

Would something like this work for you?

tell application "Microsoft Excel"
	open {file (item i of my_TXT_Files as string)}

	tell active workbook
		tell active sheet's used range
			set number format to "@"
		end tell
	end tell
end tell

Jay
 _______________________________________________
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

  • Follow-Ups:
    • Re: Import txt file in Excel and set cell options
      • From: Bert Groeneveld <email@hidden>
  • Prev by Date: Import txt file in Excel and set cell options
  • Next by Date: Re: Uniquely identify range in MS Excel
  • Previous by thread: Import txt file in Excel and set cell options
  • Next by thread: Re: Import txt file in Excel and set cell options
  • Index(es):
    • Date
    • Thread