Macros save to another location always ask sign in

%3CLINGO-SUB%20id%3D%22lingo-sub-1943311%22%20slang%3D%22en-US%22%3EMacros%20save%20to%20another%20location%20always%20ask%20sign%20in%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1943311%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20template%20Excel%20have%20macro%2C%20that%20macro%20function%20is%20save%20to%20another%20location%20(server%20local)%20using%20WebDav%20and%20convert%20type%20to%20.txt%20.%3C%2FP%3E%3CP%3EThe%20macro%20is%20work%20when%20the%20excel%20version%202010%20and%20below%2C%20but%20from%20version%202013%20(standard%2F365)%20and%20above%20always%20Pending%20and%20ask%20Sign%20in%26nbsp%3Bwhen%20i%20resolve%20with%20sign%20in%20not%20show%20anything.%3C%2FP%3E%3CP%3EUsually%20after%20execute%20macros%20always%20show%20pop%20up%20login%20(user%20have%20to%20insert%20username%20and%20password)%2C%20but%20the%20pop%20up%20never%20show.%3C%2FP%3E%3CP%3EIs%20the%20macros%20not%20compatible%20for%20higher%202010%20%3F%20or%20need%20convert%20%3F%3C%2FP%3E%3CP%3E(macro%20attach)%3C%2FP%3E%3CP%3EWarm%20Regards%20%2C%3C%2FP%3E%3CP%3ESetiawan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1943311%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1943621%22%20slang%3D%22de-DE%22%3ESubject%3A%20Macros%20save%20to%20another%20location%20always%20ask%20sign%20in%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1943621%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F886582%22%20target%3D%22_blank%22%3E%40setiawanIR%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EAs%20I%20understood%20it%20in%20the%20translation.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EHere's%20a%20little%20macro%20that%20might%20help%20you.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EYou%20only%20have%20to%20adapt%20the%20source%20path%20and%20destination%20path%20to%20your%20requirements.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EIf%20that's%20not%20what%20you%20meant%20or%20imagined%2C%20please%20just%20ignore%20it.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3ESub%20copy%20()%0ADim%20a%20As%20Double%0ADim%20file%20As%20String%0ADim%20sourcepath%20As%20String%0ADim%20destinationpath%20As%20String%0A%0A'Assign%20variables%0ASource%20path%20%3D%20%22E%3A%20%5C%20Archive%20%5C%20Original%20%5C%22%0ATarget%20path%20%3D%20%22E%3A%20%5C%20Archive%20%5C%20Original%20%5C%20History%20%5C%22%0A%0A'Recognize%20lines%0Ado%0A%20%20%20%20%20a%20%3D%20a%20%2B%201%0A%20%20%20%20%20If%20ActiveSheet.Cells%20(a%2C%201)%20.Value%20%3D%20%22History%3A%22%20Then%0A%20%20%20%20%20%20%20%20%20a%20%3D%20a%20%2B%201%0A%20%20%20%20%20%20%20%20%20Exit%20Thu%0A%20%20%20%20%20End%20If%0ALoop%20Until%20a%20%3D%205000%0AIf%20a%20%3D%205000%20Then%20Exit%20Sub%0A%0A'Copy%20files%0Ado%0A%20%20%20%20%20If%20Len%20(Cells%20(a%2C%201)%20.Value)%26gt%3B%200%20And%20Len%20(Cells%20(a%2C%209)%20.Value)%20%26lt%3B1%20Then%0A%20%20%20%20%20%20%20%20%20File%20%3D%20Cells%20(a%2C%201)%20.Value%0A%20%20%20%20%20%20%20%20%20FileCopy%20sourcepath%20%26amp%3B%20file%2C%20destinationpath%20%26amp%3B%20file%0A%20%20%20%20%20%20%20%20%20If%20Dir%20(destinationpath%20%26amp%3B%20file)%20%26lt%3B%26gt%3B%20%22%22%20And%20FileLen%20(destinationpath%20%26amp%3B%20file)%20%3D%20FileLen%20(sourcepath%20%26amp%3B%20file)%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20Kill%20sourcepath%20%26amp%3B%20file%0A%20%20%20%20%20%20%20%20%20%20%20%20%20Cells%20(a%2C%209)%20.Value%20%3D%20%22X%22%0A%20%20%20%20%20%20%20%20%20Else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20Cells%20(a%2C%209)%20.Value%20%3D%20%22ERROR%22%0A%20%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20End%20If%0A%20%20%20%20%20a%20%3D%20a%20%2B%201%0ALoop%20Until%20a%20%3D%205000%0AIf%20a%20%3D%205000%20Then%20Exit%20Sub%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E*%20Kindly%20Mark%20and%20Vote%20this%20reply%20if%20it%20helps%20please%2C%20as%20it%20will%20be%20beneficial%20to%20more%20community%20members%20reading%20here.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New 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.

 

@Nikolino  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.