saveAs UNC path fails but mapped path works

前端 未结 2 1586
栀梦
栀梦 2021-01-26 16:07

I have some Excel VBA code below that saves an Excel file. It works if I save using as a mapped drive, but fails if I use a UNC path. I double-checked the UNC path and it is c

相关标签:
2条回答
  • 2021-01-26 16:41

    Try using the Filename parameter ActiveWorkbook.SaveAs Filename:=uncPathFileName, FileFormat:=52

    The drive may be mapped to a share... So you might no have the permissions through the UNC path...

    If ActiveWorkbook.SaveAs Filename:="\\fileServer01\pathPart\myFile1.xlsm", FileFormat:=52 then there may be an access issue.

    The only other thing i can think of is trying the current format , FileFormat:=CurrentFormat

    0 讨论(0)
  • 2021-01-26 16:55

    OK, my bad. I upon triple checking I discovered the UNC path-part was misspelled.

    0 讨论(0)
提交回复
热议问题