I have a complex spreadsheet that makes extensive use of VBA, including Command Buttons and Event Handlers. I have developed it over quite a few years, and therefore quite a few versions of Excel, but only ever on Windows versions of Excel. It is able to be run on all Excel versions from 97 to 2010.
Recently, macros and VBA have stopped working completely in my version of Excel. I have the following symptoms: When opening a file with macros in it, Excel completes an 'open and repair' cycle, and removes the VBA code (listed in the repair log file).
I have had a request to provide a version for the recently released Macintosh version of Excel, 2011. The marketing material for Excel 2011 claims that it provides full support for VBA, and if this is truly the case then the conversion task should be trivial. Does anyone have any experience converting a VBA-ridden Windows-based Excel spreadsheet to Excel-2011? What sort of difficulties were encountered?
Alternatively, is anyone aware of a document somewhere on the Internet that gives an impartial and independent review of the degree of interchangeability between the two platforms? I posted this query on the Tek-Tips site a week ago, where it elicited nary a response. RE: Running Windows VBA on Excel 2011 (Macintosh) (Aerospace) 22 Feb 12 00:08.
I got a brief chance to test my spreadsheet on a Mac when I was at a social function last night. I just happened to have it on a memory stick in my pocket, and while my wife was distracted I turned antisocial and fired up our host's Mac. Results, such as they were, were very discouraging. In the couple of minutes I had before my absence was noticed I discovered: (1) The 'welcome' form that fires up when the spreadsheet is opened is supposed to close itself down automatically after 5 seconds, unless the user closes it earlier.
![]()
On Mac the auto closedown did not work. (2) None of the command buttons responded in any way when clicked upon. (3) However I was able to initiate the running of VBA code with my ctrl-shift-X style shortcuts.
(4) Some (maybe all?) reserved constants such as xlPending caused 'variable undefined' errors. I had no time to look into workarounds for these before being led by the ear back to the gathering. However I was unhappy with the experience, and will probably decline the request to produce a Mac version of the spreadsheet. (One of the conditions I imposed on myself was that the same version of the spreadsheet be able to run on both platforms, because I am not at all interested in having to maintain two versions. My conclusion from my brief experience suggests that even if I was to put in the effort to get a Mac version working, the result would not work when ported back to Windows.) Despite this, I am still interested in unearthing any succinct document about the difficulties I might encounter were I to attempt the conversion. RE: Running Windows VBA on Excel 2011 (Macintosh) (Mechanical) 24 Feb 12 15:01.
Sub ReadFile 'again, we need this strange thing to exist so that. Dim fso As New FileSystemObject 'the file we're going to read from Dim ts As TextStream '. We can open a text file with reference to it Set ts = fso.OpenTextFile('C: Wise Owl info.txt', ForReading) 'keep reading in lines till no more Dim ThisLine As String Dim i As Integer i = 0 Do Until ts.AtEndOfStream ThisLine = ts.ReadLine i = i + 1 Debug.Print 'Line ' & i, ThisLine Loop 'close down the file ts.Close End Sub Here's what this would show in the.
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |