my file doesn't save on the server

jforce

New Member
Joined
Jul 15, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
my file doesn't save on the server:

Sub Mac()

Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim ts As Worksheet
Dim ruta As String, DocName As String
Set ts = ThisWorkbook.Sheets("Mac")
ruta = "\ssnyvolumes.ny.publicisgroupe.net\Share1\North America\USA\2022\VR tasks\"
DocName = "test_template.docx"

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(ruta & DocName)
objWord.Visible = True
With objDoc
.Bookmarks("nombre").Range.Font.Bold = True
.Bookmarks("fecha").Range.Font.Bold = True
.Bookmarks("monto").Range.Font.Bold = True
.Bookmarks("nombre").Range.Text = ts.Range("c8").Text
.Bookmarks("fecha").Range.Text = ts.Range("d8").Text
.Bookmarks("monto").Range.Text = ts.Range("e8").Text
End With
DocName = "test_template.docx - " & ts.Range("d8").Text
objDoc.SaveAs2 Filename:=ruta & DocName
objDoc.Close
objWord.Quit
MsgBox "¡New Report Done", vbInformation


End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Shouldn't this:
ruta = "\ssnyvolumes.ny.publicisgroupe.net\Share1\North America\USA\2022\VR tasks\"
be (note the double backslash):
ruta = "\\ssnyvolumes.ny.publicisgroupe.net\Share1\North America\USA\2022\VR tasks\"
since it's an UNC address.
 
Upvote 0

Forum statistics

Threads
1,216,179
Messages
6,129,338
Members
449,504
Latest member
Alan the procrastinator

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top