Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-30-2015, 08:05 AM
Rose roon Rose roon is offline copy active document to shared network drive Windows 7 64bit copy active document to shared network drive Office 2007
Novice
copy active document to shared network drive
 
Join Date: Jun 2015
Posts: 28
Rose roon is on a distinguished road
Default copy active document to shared network drive

Hi,

I have to copy the active document in shared network drive
I am using this macro, it is giving the error access denied.
But read and write permissions are there for this folder.
Please advice

Appreciate your help

Private Function access_Network_share()
On Error GoTo ErrHandler
ServerShare = "\\USER1-PC\MetaData"
userName = txtUserName.Text
Password = txtPassword.Text
Set NetworkObject = CreateObject("WScript.Network")
NetworkObject.MapNetworkDrive "", ServerShare, False, userName, Password
save_As_word
NetworkObject.RemoveNetworkDrive ServerShare, True, False
Set NetworkObject = Nothing
Exit Function


ErrHandler:
MsgBox "Please check your credentials"
End Function

Private Function save_As_word()
On Error GoTo ErrHandler

Kill "D:\Metadata\" & (ActiveDocument.Name) & ".DOCX"
ActiveDocument.SaveAs "\\USER1-PC\MetaData\" & (ActiveDocument.Name)
Exit Function
ErrHandler:
End Function

Regards,
Rose
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Live updating powerpoint playing on network drive flossin345 PowerPoint 0 10-10-2013 09:50 AM
copy active document to shared network drive Could not update file on the shared network drive with Office 2010 aldo4u Word 7 07-24-2013 07:56 AM
copy active document to shared network drive Office Crashing when saving to Network Drive robbid01 Office 1 01-05-2012 03:47 PM
Hyperlinking files on a mapped network drive howler2345 Outlook 0 12-21-2011 08:54 AM
Mail Merge and Files on Network Drive Joe Switch Mail Merge 0 09-15-2011 09:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft