Hi, I have a little problem and I hope that somebody can help me.
I have a workbook, and I want that when I`m closing it to be saved and save as on a site.The code that I write is working if I have internet access and I am log in with an user that can unpload documents on the site. But there are situations when I don`t have internet or I`m not log in an user with rights and in this kind of situations I get a dialog text to enter a username and password with access and an error. If I have this situations I want that the workbook to be save only and do not the save as. I tried with On error resume next ( I don`t know how to use it exactly) and is not working.Any ideas?Thanks!
I have a workbook, and I want that when I`m closing it to be saved and save as on a site.The code that I write is working if I have internet access and I am log in with an user that can unpload documents on the site. But there are situations when I don`t have internet or I`m not log in an user with rights and in this kind of situations I get a dialog text to enter a username and password with access and an error. If I have this situations I want that the workbook to be save only and do not the save as. I tried with On error resume next ( I don`t know how to use it exactly) and is not working.Any ideas?Thanks!
Code:
Workbooks(lealde2).Save
Dim thefile, thepath As String
Let thepath = "[URL="http://teamwork.tenaris.net/sites/quality_Silcotub/Quality%20System/CapabilityAnalysis/CPKDimensional/DB/"][COLOR=#49644e]http://[/COLOR][/URL]...etc "
Let thefile = "DatabaseLealde2.xlsm"
On Error Resume Next
Workbooks(lealde2).SaveAs Filename:=thepath & thefile _
, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Workbooks(y).Worksheets("1").Activate
Workbooks(lealde2).Close SaveChanges:=True
</PRE>