Compile error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone tell me why the following code line would give a "Compile error: wrong number of arguments or invalid property assignment"

TodaysDate = Date
ActiveCell.Select
ActiveCell.AddComment

ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Text:="(" & Format(TodaysDate, "m/d", 0, 0) & ") : Issue Opened"
ActiveCell.Comment.Shape.ScaleWidth 2.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Shape.ScaleHeight 3.03, msoFalse, msoScaleFromTopLeft
 
Rog1 said:
Can anyone tell me why the following code line would give a "Compile
error: wrong number of arguments or invalid property assignment"
TodaysDate = Date
ActiveCell.Select
ActiveCell.AddComment

ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Text:="(" & Format(TodaysDate, "m/d", 0, 0) &
") : Issue Opened"
'
1) we use paranthesis in .net when making function calls.
2) this looks like VBA.
 
* "=?Utf-8?B?Um9nMQ==?= said:
Can anyone tell me why the following code line would give a "Compile error: wrong number of arguments or invalid property assignment"

TodaysDate = Date
ActiveCell.Select
ActiveCell.AddComment

ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Text:="(" & Format(TodaysDate, "m/d", 0, 0) & ") : Issue Opened"
ActiveCell.Comment.Shape.ScaleWidth 2.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Shape.ScaleHeight 3.03, msoFalse, msoScaleFromTopLeft

Doesn't seem to be VB.NET code. Why not post to the appropriate VB
Classic/VBA group?
 
It does look like (XL) VBA, and it looks like you are trying to double
assign a text parameter?
2) this looks like VBA.

vs ActiveCell.Comment.Text ="(" & Format.....[etc]

assuming that was the line that threw the error....

For any additional issues or followup,
Microsoft.Public.Excel.Programming
might provide more targeted responses.

:-)
 
None the less... its definatly not .NET =)

Keith R said:
It does look like (XL) VBA, and it looks like you are trying to double
assign a text parameter?
2) this looks like VBA.
0)

vs ActiveCell.Comment.Text ="(" & Format.....[etc]

assuming that was the line that threw the error....

For any additional issues or followup,
Microsoft.Public.Excel.Programming
might provide more targeted responses.

:-)
 
Hi Rog,
Can anyone tell me why the following code line would give a "Compile
error: wrong number of arguments or invalid property assignment"
TodaysDate = Date
ActiveCell.Select
ActiveCell.AddComment

ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Text:="(" & Format(TodaysDate, "m/d", 0, 0) & ") : Issue Opened"
ActiveCell.Comment.Shape.ScaleWidth 2.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Shape.ScaleHeight 3.03, msoFalse,
msoScaleFromTopLeft

Some of this instructions needs arguments, that are one or more parameters
inside () or some of them needs a propery assignment, that is always one
behind a =.

They both have to be from the format and the ammount that is suspected.
There can only be one property.

I hope this helps?

Cor
 
Back
Top