Мне нужно сохранить вложенный документ Word из Excel в папку Windows% temp%. Мое текущее решение не работает. Где ошибка?
Dim tempFolderPath As String
Dim filePath As String
Dim fileTitle As String
tempFolderPath = Environ("Temp")
fileTitle = ThisWorkbook.Sheets("Other Data").Range("AK2").Value & ", " & _
ThisWorkbook.Sheets("Other Data").Range("AK7").Value & "_" & _
ThisWorkbook.Sheets("Other Data").Range("AK8").Value & "_" & _
ThisWorkbook.Sheets("Other Data").Range("AU2").Value
objWord.SaveAs2 filePath = tempFolderPath & "\" & fileTitle & ".docx"