Article ID: 155553
Article Last Modified on 10/11/2006
Sub Test()
Dim oTmgr As Object
Set oTmgr = GetObject(, "TeamManager.Application")
oTmgr.File "My File"
End Sub
Macro Line Error Message
---------- -------------
oTmgr.File "My File" Type mismatch
oTmgr.File.Name "My File" Unable to write read-only property
-----------------------------------------------------------------
oTmgr.File = "My File" Unable to write read-only property
oTmgr.File.Name = "My File" Unable to write read-only property
-----------------------------------------------------------------
oTmgr.File Argument not optional
oTmgr.File.Name Argument not optional
Because Name is the default property of the File object, the line
oTmgr.File "My File"
should produce the same error message as the line:
oTmgr.File.Name "My File"
NOTE: The correct way for a macro to rename the current team file is to
save it out with a different name using the Application object's SaveAs
method. For example:
Sub Test()
Dim oTmgr As Object
Set oTmgr = GetObject(, "TeamManager.Application")
oTmgr.SaveAs "C:\My File"
End Sub
Additional query words: 1.00
Keywords: kbdtacode kberrmsg kbprogramming KB155553