August 18th, 1999, 09:05 AM
I wrote an application in Visual Basic that uses an automation interface. There is a method defined in the interface called "Print" which is a keyword. To solve this problem, I put square brackets around the word when I called it, like this:
pDoc.[Print] " ", txtFirst, txtLast, chkNotes, chkAttributes, chkForm, chkAnnotations
and it worked fine.
Now, I am pretty much writing the same application, but in Excel using macros. Now, when I want to call the same Print method, the exact same way I called it in the other application, it doesn't work!
The error I get is:
Expected: "(" and it highlights the first parameter, which is a string. I have tried putting " " and a variable name in for the string, but it still doesn't work.
Does anyone know if there is something different I have to do with keywords when I am using Visual Basic with Excelt marcros?
Thanks!
pDoc.[Print] " ", txtFirst, txtLast, chkNotes, chkAttributes, chkForm, chkAnnotations
and it worked fine.
Now, I am pretty much writing the same application, but in Excel using macros. Now, when I want to call the same Print method, the exact same way I called it in the other application, it doesn't work!
The error I get is:
Expected: "(" and it highlights the first parameter, which is a string. I have tried putting " " and a variable name in for the string, but it still doesn't work.
Does anyone know if there is something different I have to do with keywords when I am using Visual Basic with Excelt marcros?
Thanks!