PDA

View Full Version : Solved: Cross platform form problem PC to Mac



prm
10-19-2005, 12:13 PM
Hi, I'm new to this group and I have an Excel VBA problem. I can program VBA on a PC, but unsure on a Mac.

Problem:
I have an Excel spreadsheet that uses userforms to put data into a master spreadsheet. Works great on a PC, but fails on a Mac.

Both forms fail with the error Compile error: Wrong number of agruments or invalid property assignments

One form opens with a simple command:
Sub Picture2_Click()
NEXTPRACA.Show False
End Sub

The other form opens with:
Sub TextBox4_Click()
Application.ScreenUpdating = False
Range("A1:t99").AdvancedFilter _
Action:=xlFilterCopy, _
CriteriaRange:=Range("u1:u2"), _
CopyToRange:=Range("v1:ao1"), Unique:=False
Range("w2:ao2").Copy
Sheets("PRACA").Select
Range("A3:s3").Select
Selection.PasteSpecial
Sheets("Select").Select
Range("a2:a99").ClearContents
Application.CutCopyMode = False
Range("A2").Select
Application.ScreenUpdating = True
NEXTPRACA1.Show False
End Sub

Both forms have add/change that will add the data to master spreadsheet. However, the form will not even open on a Mac.

Any help or suggestions would be appreciated.

Thank you,
prm

BlueCactus
10-19-2005, 03:54 PM
I can tell you what your problem is, although what you want to do about it is an entirely different question.

Win Office 97 and all recent versions of Mac Office are based on Visual Basic 5 which does not support modeless userforms. So, the error is caused by having the 'False' tacked on to your form.Show (one too many arguments).

So the next question is.... do you:

a) need to keep the form modeless. (This will require a rethink on your part.)
b) want to keep it modeless for Win Office as a convenience, but modal on Mac is fine.
c) think that modal on both Win and Mac is fine (in which case just remove the 'False').

prm
10-20-2005, 05:26 AM
Thank you for your support! That was it. I went with option C and it works fine.

Thanks again!
prm:)