Abra a pasta de trabalho de arquivos, feche se já estiver aberta
codeWorkBookPath = "Directory\"
codeWorkBookName = "file.xlsm"
codeWorkBookFullPathName = UCase(Trim(codeWorkBookPath)) &
UCase(Trim(codeWorkBookName))
codeWorkbookAlreadyOpen = CommonWorkbook.isWbOpen(codeWorkBookName)
If Not codeWorkbookAlreadyOpen Then
Workbooks.Open Filename:=codeWorkBookFullPathName, UpdateLinks:=False,
ReadOnly:=True
End If
ativar a planilha inicial
Workbooks(startWorkBook).Activate
Sheets(startWorkSheet).Activate
Execute o macroName
argString = "'" & Trim(codeWorkBookName) & "'!" & Trim(macroName)
APPLICATION.Run argString