Macro in excel to save to an unmapped drive !

R

robinraw

Help...
Can anybody hlep me out here... I am trying to construct a macro part
of which will save a file to an unmapped drive, i can do this when the
filename is static but I need to change the filename
cellvalue2 = Sheets("explanations").Range("F1").Text
myvalue = cellvalue2
ActiveWorkbook.SaveAs Filename:=myvalue


I can also do it when I have a mapped drive by using CHDRIV "E:"

but not to an unmapped one !


Can anybody help?
 
D

Dave Peterson

Maybe....

dim myPath as string
dim CellValue2 as string

'point at the UNC path here.
myPath = "\\server\folder\folder\"
if right(mypath,1) <> "\" then
mypath = mypath & "\"
end if

cellvalue2 = Sheets("explanations").Range("F1").Text
ActiveWorkbook.SaveAs Filename:=mypath & cellvalue2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top