Excel 2004 and special characters : big bug ?

E

Eric SURIN

The new version of MS Excel (2004) seems to present a lot of drawbacks/bugs.
I have already notice the following ones :
- incompatibility of Applescript coding with previous versions
- serious problems with fonts and table of characters
- several VBA commands are no longer supported, without any replacement
(Application.FileFind and others...)

Once more, Microsoft shows it does not care, even a little, for its clients
and for the compatibility of its products between versions...

Does anyone have found a solution to get special characters (ALT + letter)
to appear in the spreadsheet ? I have tried to find a workaround with VBA
using command CHR(ASCII code) but to noavail...

Thanks for your help.
Eric
 
B

Bob Greenblatt

The new version of MS Excel (2004) seems to present a lot of drawbacks/bugs.
I have already notice the following ones :
- incompatibility of Applescript coding with previous versions
- serious problems with fonts and table of characters
- several VBA commands are no longer supported, without any replacement
(Application.FileFind and others...)

Once more, Microsoft shows it does not care, even a little, for its clients
and for the compatibility of its products between versions...

Does anyone have found a solution to get special characters (ALT + letter)
to appear in the spreadsheet ? I have tried to find a workaround with VBA
using command CHR(ASCII code) but to noavail...

Thanks for your help.
Eric
Lighten up Eric. Your editorial is nonsense! Microsoft has demonstrated via
Office 2004 that it is just the opposite of what you stated and cares a
great deal for its customers and product compatibility.

-There have been HUGE improvements with apple script between Excel X and
2004. The entire dictionary has changed. You will have to recompile your
scripts with the new dictionary. You'll find the new implementation is MUCH
better than the older one.

-what are the serious problems with fonts and tables of characters? Get
specific and we can help.

What special characters are you looking for? Try the keyboard viewer, you'll
see a whole bunch of option-character choices. Inserting characters with VBA
also works fine. What problems are you having. You are doing something
wrong, because it works fine.
 
E

Eric SURIN

First, format a the A1 cell with the Wingdings font. Then type in ALT + Y
(or CRH(242) in VBA).
In Excel X and other softwares (including keyboard viewer), you get a down
arrow whereas in Excel 2004 you get another character. And it's the same
thing with all characters obtained with option keys.
Moreover, when you type in SHIFT + ALT + whatever letter, Excel 2004
automatically change the font in your cell to Arial...

If you have a solution, I would be thankful.

Eric

PS:
For applescript, maybe the new version is more powerful but you have to
rewrite your whole code since it's absolutely not compatible with previous
versions of Excel. They could have supported the old dictionary for a time
as they have done before with VBA improvements. On top of that, Excel 2004
is not "recordable", whereas Excel X was... That does not help.




dans l'article BDE2FA00.29C4E%[email protected], Bob Greenblatt à
(e-mail address removed) a écrit le 13/12/04 13:49 :
 
J

JE McGimpsey

Eric SURIN said:
First, format a the A1 cell with the Wingdings font. Then type in ALT + Y
(or CRH(242) in VBA).
In Excel X and other softwares (including keyboard viewer), you get a down
arrow whereas in Excel 2004 you get another character. And it's the same
thing with all characters obtained with option keys.
Moreover, when you type in SHIFT + ALT + whatever letter, Excel 2004
automatically change the font in your cell to Arial...

If you have a solution, I would be thankful.

You must have a different keyboard layout than I do. For me in both
XLv.X and XL04, OPTION-Y is ascii 180, not 242. If I use
SHIFT-OPTION-Y, I get ascii 231.

For me, =CHAR(242) is typed with SHIFT-OPT-;

I also can't reproduce your automatic change in font. For me, the font
stays the same until I change it, unless I insert a Unicode glyph that
doesn't exist in the font I'm using (in which case it changes to a font
that does).
 
E

Eric SURIN

You must have a different keyboard layout than I do. For me in both
XLv.X and XL04, OPTION-Y is ascii 180, not 242. If I use
SHIFT-OPTION-Y, I get ascii 231.

I indeed use a French keyboard with French version of Excel 2004 and French
as international parameters in MacOS X.
 
J

JE McGimpsey

Eric SURIN said:
For applescript, maybe the new version is more powerful but you have to
rewrite your whole code since it's absolutely not compatible with previous
versions of Excel. They could have supported the old dictionary for a time
as they have done before with VBA improvements.

It's a real PITA, but I think the break is more beneficial than trying
to cobble together a synthesis. I suspect that the complexity of doing
so would have prevented Office 2004 from shipping with the new version.
The new version uses the same object model as VBA, instead of being
pasted on. One benefit is that the syntax is, for the most part,
derivable from an understanding of that model (AFAIC, the best
documentation for Applescript in Office 2004 is VBA Help).

Trying to reconcile the two sytaces would, IMO, have been extremely
difficult and confusing. I'm not sure what VBA improvements you think
were supported - AFAIK, there hasn't been any deprecation of VBA methods
or properties.
On top of that, Excel 2004 is not "recordable", whereas Excel X
was... That does not help.

True, that's a pain.
 
P

Paul Berkowitz

PS:
For applescript, maybe the new version is more powerful but you have to
rewrite your whole code since it's absolutely not compatible with previous
versions of Excel. They could have supported the old dictionary for a time
as they have done before with VBA improvements. On top of that, Excel 2004
is not "recordable", whereas Excel X was... That does not help.

That would be impossible, and ridiculous. Only one dictionary will work at a
time. The new dictionary is _much_ more powerful. You can go back to Excel X
if matters are urgent.

Don't open your X scripts in 2004: the Excel commands will be
incomprehensible «raw codes». To adapt your X scripts for 2004:


1. Quit Excel 2004. Quit Script Editor. Log out (Apple menu) and log in
again.
2. Open Excel X (if necessary, reinstall it from the Office X CD). Open
Script Editor.
3. Open your Excel X scripts in Script Editor.
4. With each script, go to File/Save As. Choose Text from the File
Format pop-up menu. You'll notice the extension changes to .applescript.
Save it anywhere on your Mac.
5. Quit Excel X and Script Editor. Log out and then in again.
6. Open Excel 2004, then launch Script Editor.
7. Open the .applescript Text versions of your scripts in Script Editor.
You will now see‹in uncompiled text‹the original text of the scripts (not
the strange «raw codes» of the compiled script versions).
8. Open the Excel 2004 dictionary in Script Editor (choose File->Open
Dictionary->Microsoft Excel). If you are in any doubt as to which Excel
dictionary is the one for 2004, instead click the Browse button at the
bottom of the window and navigate to Applications->Microsoft Office 2004®
Microsoft Excel.
9. Most of the Excel X commands and classes ‹ which look like
SquishedWordsTogether from the Excel X version ‹ have very close equivalents
in the Excel 2004 dictionary but as 'separate lowercase words'. Change your
old text to the new dictionary commands as needed. Make sure to check
through all the Suites in the dictionary to find the terms you need: the
Microsoft Excel Suite and the Table Suite will be the ones you need most
often.
10. Click the Compile button, and debug (fix the line in which a
highlighted word appears if you get an error ‹ it may be the preceding word
that has the problem) as necessary.
11. When properly compiled so the styled formatting appears when you click
the Compile button, Save As Script or Application.



--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
J

JE McGimpsey

Paul Berkowitz said:
8. Open the Excel 2004 dictionary in Script Editor (choose File->Open
Dictionary->Microsoft Excel). If you are in any doubt as to which Excel
dictionary is the one for 2004, instead click the Browse button at the
bottom of the window and navigate to Applications->Microsoft Office 2004®
Microsoft Excel.

Just another way:

drag the XL04 application icon onto the Script Editor icon.
 
P

Paul Berkowitz


Hot off the press - today, I think. (The Word ref has been revised too.)
Paul can give you the skinny on this publication.


I'll do my best, anyway. The front section "Using the Excel Dictionary" is
well worth reading straight through.


--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
E

Eric SURIN

Thanks to all of you for your answers.

To convert my AppleScripts for the new version of Excel is one of the
issues. Anyway, I will have to do it sooner or later.

But the main issue is that my scripts are executed on different computers
(from a server application), some computers running MacOS 10.2 and Excel X,
some running 10.3 and Excel X and a few running 10.3 and Excel 2004.

So, how can I manage 2 different versions of my AppleScripts ? (when they
are executed, I can not guess what version of Excel the client computer
runs).

If someone can help :)
Thanks.
Eric



dans l'article #[email protected], Jim Gordon MVP à
(e-mail address removed) a écrit le 14/12/04 2:31 :
 
P

Paul Berkowitz

To convert my AppleScripts for the new version of Excel is one of the
issues. Anyway, I will have to do it sooner or later.

But the main issue is that my scripts are executed on different computers
(from a server application), some computers running MacOS 10.2 and Excel X,
some running 10.3 and Excel X and a few running 10.3 and Excel 2004.

So, how can I manage 2 different versions of my AppleScripts ? (when they
are executed, I can not guess what version of Excel the client computer
runs).

If someone can help :)

In this case, you'll need to combine both versions in one script.

Once you have created a 2004 version of the script that works, open it in
Script Editor while Excel 2004 is open. Then open the original Excel X
script in Script Editor. You will see all the Excel X code as strange «raw
codes». Don't worry about it.

Open a new script window. Start out this way:


tell application "Microsoft Excel" to set theVersion to version as string

set AppleScript's text item delimiters to {"."}
set mainVersion to (text item 1 of theVersion) as integer
set AppleScript's text item delimiters to {""}
if mainVersion < 11 then
my ExcelXScript()
else
my Excel2004Script()
end if



on ExcelXScript()



end ExcelXScript


on Excel2004Script()



end Excel2004Script



Then copy and paste the entire Excel X version, raw codes and all, into the
on ExcelXScript() section, and copy and paste the entire Excel 2004 version
into the Excel2004Script() section. Compile and save. Now it will work with
either version.

Important: in order to work properly on computers that have both X and 2004
open the Excel you want to use first before running the script. This is even
more important if any of the computers have a Classic version (2001, 98,
etc.) of Excel which might have been in use recently.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
P

Paul Berkowitz

Sure. But I just thought of a problem: If any of your scripts use handlers
(subroutines), you'll have to rename the 2004 version of each handler
(simplest would be just to add '2004' to the end of the handler name), and
remember to call it from within the Excel2004() handler by the correct new
name. You can't have two handlers with the same name in the same script. And
you'd have to put all the handlers outside the ExcelXScript() and
Excel2004Script() handlers (can't have handlers within handlers). This is
getting complicated and open to problems.

So - if you do use any subroutines, it would actually be much easier to
construct this as two script objects rather than two subroutines. That way
you wouldn't have to rename anything, wouldn't have to re-write anything o
remember to call handlers by new names, etc. You may not be familiar with
script objects, but it's much easier here. (It will work even if you don't
have any handlers, so you can just use the same structure for all your
scripts.)

After getting the version as before do this:

tell application "Microsoft Excel" to set theVersion to version as string

set AppleScript's text item delimiters to {"."}
set mainVersion to (text item 1 of theVersion) as integer
set AppleScript's text item delimiters to {""}

if mainVersion < 11 then
run ExcelXScript
else
run Excel2004Script
end if

script ExcelXScript

--paste X script here

end script


script Excel2004Script

-- paste 2004 script here

end script



NOW you really can paste in the entire scripts and not have to worry about
re-jigging handlers, renaming them or remembering to call them by new names.
This is much better - I should have told you this before. It will work with
simple copy-and-paste with all your scripts, handlers or not. (Note there
are no () parentheses in the script names now and none when calling them.
You just 'run' them.)
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 

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