Vote count:
0
I have this code
TemplatesFolder = Replace(ThisWorkbook.FullName, ThisWorkbook.Name, "")
Dim WA As Object, WD As Object
Set WA = CreateObject("Word.Application")
FileName = TemplatesFolder & "Templates\" & "temp.docx"
Set WD = WA.Documents.Add(FileName)
I get error that FileName not found until i open this docx file manualy and press allow edit notification. After this actions this code work well. This hapens on all new computers where runing first time excel file.
How to prevent this error?
asked 1 min ago
Excel vba open Word file
Aucun commentaire:
Enregistrer un commentaire