Re: Word VBA: run-time error 75
Tnx to admin (sorry), now is clear.
fixed the problem, and
Regarding to problem:
"ActiveDocument.Save" inside the code, fixed all and there is no error.
Re: Word VBA: run-time error 75
Tnx to admin (sorry), now is clear.
fixed the problem, and
Regarding to problem:
"ActiveDocument.Save" inside the code, fixed all and there is no error.
This code renames Word document: first, detect path, then name and extension, close document and renames it, and open again.
Code is stored in Normal.dotx.
...but - when file is locally stored (hard disk) i have "run-time error 75", after this i click "Debug" and "Continue" and everything is OK. When file i stored on network disk - there is no error message??!!
Sub RenameCurrentFile()
Dim wdApp As Object
On Error GoTo 0
'OBAVEZNO: staviti ovo u Normal.dot!
Application.DisplayAlerts = False
staroime = ActiveDocument.FullName
samofolder = ActiveDocument.Path
If (Right(Left(staroime, Len(staroime) - 4), 1)) <> "." Then
novoime = Left(staroime, Len(staroime) - 4)
ekst = 4
Else
novoime = Left(staroime, Len(staroime) - 5)
ekst = 5
End If
ekstenzija = Right(staroime, ekst)
novo = novoime & "_INTERNAL" & ekstenzija
ActiveWindow.Close
'here the error begins!
Name staroime As novo 'rename
Application.DisplayAlerts = True
Documents.Open(novo).Activate 'open again
End Sub
Display More
Additionally:
- i have all user access permissions
- file is not Read-Only
tnx