Share via


_Application.RecordMacro Method

Records code if the macro recorder is on.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Sub RecordMacro ( _
    BasicCode As Object, _
    XlmCode As Object _
)
'Usage
Dim instance As _Application
Dim BasicCode As Object
Dim XlmCode As Object

instance.RecordMacro(BasicCode, XlmCode)
void RecordMacro(
    Object BasicCode,
    Object XlmCode
)

Parameters

  • BasicCode
    Type: System.Object

    Optional Object. A string that specifies the Visual Basic code that will be recorded if the macro recorder is recording into a Visual Basic module. The string will be recorded on one line. If the string contains a carriage return (ASCII character 10, or Chr$(10) in code), it will be recorded on more than one line.

  • XlmCode
    Type: System.Object

    Optional Object. This argument is ignored.

Remarks

The RecordMacro method cannot record into the active module (the module in which the RecordMacro method exists).

To prevent recording (for example, if the user cancels your dialog box), call this function with two empty strings.

See Also

Reference

_Application Interface

_Application Members

Microsoft.Office.Interop.Excel Namespace