Macros save to another location always ask sign in

Copper Contributor

Hi,

 

I have template Excel have macro, that macro function is save to another location (server local) using WebDav and convert type to .txt .

The macro is work when the excel version 2010 and below, but from version 2013 (standard/365) and above always Pending and ask Sign in when i resolve with sign in not show anything.

Usually after execute macros always show pop up login (user have to insert username and password), but the pop up never show.

Is the macros not compatible for higher 2010 ? or need convert ?

(macro attach)

Warm Regards ,

Setiawan

3 Replies

@setiawanIR 

As I understood it in the translation.

Here's a little macro that might help you.

You only have to adapt the source path and destination path to your requirements.

If that's not what you meant or imagined, please just ignore it.

 

Sub copy ()
Dim a As Double
Dim file As String
Dim sourcepath As String
Dim destinationpath As String

'Assign variables
Source path = "E: \ Archive \ Original \"
Target path = "E: \ Archive \ Original \ History \"

'Recognize lines
do
     a = a + 1
     If ActiveSheet.Cells (a, 1) .Value = "History:" Then
         a = a + 1
         Exit Thu
     End If
Loop Until a = 5000
If a = 5000 Then Exit Sub

'Copy files
do
     If Len (Cells (a, 1) .Value)> 0 And Len (Cells (a, 9) .Value) <1 Then
         File = Cells (a, 1) .Value
         FileCopy sourcepath & file, destinationpath & file
         If Dir (destinationpath & file) <> "" And FileLen (destinationpath & file) = FileLen (sourcepath & file) Then
             Kill sourcepath & file
             Cells (a, 9) .Value = "X"
         Else
             Cells (a, 9) .Value = "ERROR"
         End If
     End If
     a = a + 1
Loop Until a = 5000
If a = 5000 Then Exit Sub
End Sub

 

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

 

@NikolinoDE  Thanks for reply , in target doesn't have excel installation so we use the save as to another location . 

I just confused with my macros only work in office version 2010 and beyond.