Another Mac VBA bug

J

John Korchok

If you've ever tried the RmDir command in Mac VBA, you've noticed it doesn't
work. This is because each Mac folder contains a hidden file called "Icon".

RmDir doesn't work on folders that contain files, so your next step might be
to use Kill to delete the hidden file. Of course, Kill, doesn't work on
hidden files, so first you have to change it to a normal file using GetAttr
with the vbNormal constant.

Unfortunately, the GetAttr command doesn't work on the Mac. Even though Mac
VBA help includes vbNormal and vbHidden as two of GetAttr's valid constants,
VBA doesn't actually change an invisible file to a visible one. So you can't
delete a folder!

Attempting to report this bug to Microsoft resulted (once more!) in a
request for $245 for Advanced Support. Thanks Bill!

BTW, if you're ever trying to delete a folder created by Office installation
on Windows, you can do it with the above GetAttr-Kill-RmDir series, as each
MS folder contains a hidden, read-only file called mscreate.dir that must
made visible and deleted.

--

John Korchok

Word Lab Systems, Inc.
www.wordlab.ca
 
J

John McGhie

Hi John:

Yeah, VBA has a few "issues" on the Mac :)

They're not putting any money into it because VBA is supposed to go away
(should have gone away by now, except that the Fortune 500 wouldn't change
their legacy code).

Eventually, we will get VB.NET as the replacement. This change is very
necessary, because VB.NET can be properly secured against the toxic soup we
are pleased to call the Internet, whereas the design of VBA prevents that
level of security.

I am currently campaigning to have Microsoft bring VB.NET to the Mac. Wanna
join me?

Cheers


If you've ever tried the RmDir command in Mac VBA, you've noticed it doesn't
work. This is because each Mac folder contains a hidden file called "Icon".

RmDir doesn't work on folders that contain files, so your next step might be
to use Kill to delete the hidden file. Of course, Kill, doesn't work on
hidden files, so first you have to change it to a normal file using GetAttr
with the vbNormal constant.

Unfortunately, the GetAttr command doesn't work on the Mac. Even though Mac
VBA help includes vbNormal and vbHidden as two of GetAttr's valid constants,
VBA doesn't actually change an invisible file to a visible one. So you can't
delete a folder!

Attempting to report this bug to Microsoft resulted (once more!) in a
request for $245 for Advanced Support. Thanks Bill!

BTW, if you're ever trying to delete a folder created by Office installation
on Windows, you can do it with the above GetAttr-Kill-RmDir series, as each
MS folder contains a hidden, read-only file called mscreate.dir that must
made visible and deleted.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 
F

Fredrik Wahlgren

Bringing VB.NET to the Mac seems like a good campaign. I'd like to join.
What do you do?

/ Fredrik
 
B

Beth Rosengard

Beth,

I know I'm coming to this late, but what are you "ditto-ing"?

Sorry, I've been away for a few days myself. I was ditto-ing my reply to a
previous post by the same OP where I said I would escalate a VBA bug to MS,
which I did. I should also have noted that it is unlikely that MS will put
much (any?) effort into improving VBA when its efforts are turned toward
developing .net (for the PC at present).

--
***Please always reply to the newsgroup!***

Beth Rosengard
Mac MVP

Mac Word FAQ: <http://word.mvps.org/MacWordNew/index.htm>
Entourage Help Page: <http://www.entourage.mvps.org>
 
P

Paul Berkowitz

Sorry, I've been away for a few days myself. I was ditto-ing my reply to a
previous post by the same OP where I said I would escalate a VBA bug to MS,
which I did. I should also have noted that it is unlikely that MS will put
much (any?) effort into improving VBA when its efforts are turned toward
developing .net (for the PC at present).

MacBU is, however, currently committed to improving AppleScript for Office.
So far that has mostly meant "making it equivalent to VBA" plus getting
AppleScript-only features working. But at such point that they actually
_improve_ the AppleScript features or add new classes (objects), properties
or commands (methods) to correspond to new UI features - since it's the same
Object Model as used by VBA I find it hard to imagine that they won't
improve it at the lower level where it also affects VBA at the same time.
That would improve it in a "Mac-only", non-cross-platform fashion in most
cases. That still seems more likely than their doing anything involving .NET
on the Mac, since there have been no signs from either MS or Apple that the
latter is going to happen.

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

Similar Threads

VBA- Deleting a file problem... 4
Check For File 4
Special problem deleting a folder 3
deleting files using kill statement 2
RmDir 2
Mac OSX VBA bug 3
delete folder 3
Wildcards not working with SetAttr 1

Top