Re: Read a cell in Excel 2004
Re: Read a cell in Excel 2004
- Subject: Re: Read a cell in Excel 2004
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 10 Nov 2004 10:03:42 -0800
Yes.
tell app "Microsoft Excel"
set Pubdate to value of cell "B3"
end tell
set Pubdate to date string of Pubdate
--> "Thursday, November 4, 2004"
--in OS 10.3:
set Pubdate to short date string of Pubdate
--> "11/4/04" -- in whatever format you have set in International System
Preferences/Format
If you need the leading zeroes for month and day ("11/04/04"), you'll need
to set that format in International System Preferences/Format/Short Date.
Or you can use a subroutine of your own (I can give you one), which will
also work in OS 10.2, to get a short date string of your choosing from
dates.
--
Paul Berkowitz
> From: Nan Mossey <email@hidden>
> Date: Wed, 10 Nov 2004 11:36:00 -0500
> To: Paul Berkowitz <email@hidden>, AppleScript-Users
> <email@hidden>
> Subject: Re: Read a cell in Excel 2004
>
> I see were it's going wrong. Getting text of returns "11/04/04", but getting
> value of returns " date "Thursday, November 4, 2004 12:00:00 AM"", which my
> database is not prepared to accept. Is there a way to just get the text?
>
>
> On 11/10/04 10:46 AM, "Paul Berkowitz" <email@hidden> wrote:
>
>> On 11/10/04 7:35 AM, "Nan Mossey" <email@hidden> wrote:
>>
>>> I'm having trouble with this, as well. I'm creating list of variables from
>>> an an excel sheet to be transferred to another database . Info varies from
>>> numbers to text to date. I've changed this (excel X):
>>> set Pubdate to text of cell "r3c2"
>>>
>>> To this (excel 2004):
>>> set Pubdate to value of range ("B3")
>>> And also
>>> set Pubdate to (get value of range ("B3"))
>>> And also
>>> set Pubdate to value of range ("B3") as string
>>>
>>> ...with no success.
>>>
>>> Any help out there? Thanks.
>>
>>
>> set Pubdate to value of cell "B3"
>>
>> or
>>
>> set Pubdate to value of cell "$B$3" -- absolute reference
>>
>> should be working fine. If the value is text it will be Unicode.
>>
>> range "B3" should work too. Are you sure you have that worksheet in front?
>> Since you're not specifying a sheet or workbook Excel will use the active
>> sheet by default. If you want another sheet or workbook you have to say so.
>
> --
> Nan Mossey
> Times Union Publications Manager
> 1 News Plaza
> Albany NY 12212
>
> 518-454-5704
>
>
> ========================================================
> This e-mail message is intended only for the personal
> use of the recipient(s) named above. If you are not
> an intended recipient, you may not review, copy or
> distribute this message.
>
> If you have received this communication in error,
> please notify the Albany Times Union Help Desk
> (email@hidden) immediately by e-mail and
> delete the original message.
> ========================================================
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden