Windows XL, Mac XL, and the Ribbon?


M

Mike

Hi,

cross-platform issue here; I'm using WinXP XL2007 SP2, and a colleague
is using Mac XL2008.

I have an Excel VBProject that
-has ribbon modifications in the xml (from the teachings of Ron
deBruin) (code below),
-is locked from viewing with a password
-has a Selfcert digital signature
-is in a .xlsm workbook that is protected

The code all shows as compiling fine both on my computer and on the
Mac. It works fine on my computer. It works fine on the Mac.
Except...
Everytime Mac XL opens up the file, makes any changes to data on the
worksheet (VB runs during the changes), saves the file, Win XL gets
the "Error, Save/Restart your workbook" kicked out in
RefreshRibbon(). The ribbon routines are all about hiding/showing/
enabling/disabling sections of the ribbon. Mac XL seems to either: 1)
strip off the digital signature or 2) do something to the XML that I
can't figure out

The only changes I've done to Ron's code below is that I put the
entire code section in a conditional compile (#if Mac then #else ....
#end if structure). And the code that calls the RefreshRibbon is also
"#if...#end if" out for Mac

what can I do to enable this code to run successfully on both the Mac
XL and Win XL? and go back and forth between...

I can post more code if it helps

TIA!
Mike.

Ron's code (learned from this article http://msdn.microsoft.com/en-us/library/ee633442(office.11).aspx)
--------------------------------------------------------------
Dim Rib As IRibbonUI
Public MyTag As String

'Callback for customUI.onLoad
Sub RibbonOnLoad(ribbon As IRibbonUI)
Set Rib = ribbon
End Sub

Sub GetVisible(control As IRibbonControl, ByRef visible)
If MyTag = "show" Then
visible = True
Else
If control.Tag Like MyTag Then
visible = True
Else
visible = False
End If
End If
End Sub

Sub RefreshRibbon(Tag As String)
MyTag = Tag
If Rib Is Nothing Then
MsgBox "Error, Save/Restart your workbook"
Else
Rib.Invalidate
End If
End Sub
 
Ad

Advertisements

J

Jim Rech

So the question is why isn't Rib set, right? It either is never set or
becoming unset.

To check the first option I'd revise RibbonOnLoad so I could see if it is
even getting called in the post-Mac load. If you hit the Stop it is.

Sub RibbonOnLoad(ribbon As IRibbonUI)
Stop
Set Rib = ribbon
End Sub
 
M

Mike

Jim,

so I tried your suggestion. didn't seem to hit the Stop, which would
indicate the RibbonOnLoad is never getting called post Mac, correct?

Anyone know what would cause that and how do I fix it?

Regards
 
J

Jim Rech

Do you have "Show add-in user interface errors" turned on under Excel
options, Advanced, General? If not you wouldn't get a warning if the XML is
screwed up.

Jim,

so I tried your suggestion. didn't seem to hit the Stop, which would
indicate the RibbonOnLoad is never getting called post Mac, correct?

Anyone know what would cause that and how do I fix it?

Regards
 
M

Mike

Jim,

I checked, was not enabled, so I enabled it, but this doesn't seem to
be the issue.

After that, my Mac colleague and I did some digging in the files
When I send Mac a working file, and we look into the file as a .zip
file, he sees the same folders & files I do.
When Mac opens the file in Excel and then saves, and looks into the
newly saved file as a .zip, the customUI folder is missing!

He manually copied the customUI folder back into the zip version of
the file, sent me the file, and there are a bunch of 0kb files, all
named the same as the folders, as well as a MACOSX folder & 0kb file
that he can't see on his Mac.

Any ideas? It appears that when the Excel For Mac saves the file, it
strips out my customUI, and potentially adds a few system files. when
I tried opening an earlier copy (that he had saved & sent me) as a
zip, I get an error that the zip file is corrupt or invalid.


We're going to dig a little more, but if anyone has an idea on where
to dig, it'd be appreciated!!
 
J

Jim Rech

I know nothing about Macs I'm afraid and it's amazing to hear that they
remove ribbonx from files they save. If you can't find a way to fix this I
can only suggest that you put your ribbonx in an addin that your main file
opens and closes when it is activated and deactivated. This can be a hassle
of course since users have to keep the files together.

Jim,

I checked, was not enabled, so I enabled it, but this doesn't seem to
be the issue.

After that, my Mac colleague and I did some digging in the files
When I send Mac a working file, and we look into the file as a .zip
file, he sees the same folders & files I do.
When Mac opens the file in Excel and then saves, and looks into the
newly saved file as a .zip, the customUI folder is missing!

He manually copied the customUI folder back into the zip version of
the file, sent me the file, and there are a bunch of 0kb files, all
named the same as the folders, as well as a MACOSX folder & 0kb file
that he can't see on his Mac.

Any ideas? It appears that when the Excel For Mac saves the file, it
strips out my customUI, and potentially adds a few system files. when
I tried opening an earlier copy (that he had saved & sent me) as a
zip, I get an error that the zip file is corrupt or invalid.


We're going to dig a little more, but if anyone has an idea on where
to dig, it'd be appreciated!!
 
Ad

Advertisements

C

Clif McIrvin

[ ]

Any ideas? It appears that when the Excel For Mac saves the file, it
strips out my customUI, and potentially adds a few system files. when
I tried opening an earlier copy (that he had saved & sent me) as a
zip, I get an error that the zip file is corrupt or invalid.


We're going to dig a little more, but if anyone has an idea on where
to dig, it'd be appreciated!!
 

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