Cross domain file copy in Excel VBA
Here is a question that is almost similar to my previous question here, however my previous question was in VB.NET and now I will need to do the same in Excel VBA.
Basically, I have a file that is being generated automatically on a server in a Windows domain, say, called, "prod" and I will need to have VBA to transmit this file开发者_StackOverflow中文版 to another server in another Windows domain, say, "QA", where QA and Prod have different credentials altogether and I have to authenticate that credential every time I opened up the destination folder.
Therefore, I guess the regular filecopy method would not work, is there another way where we can accomplish this?
Thanks!
P.S. Here is the link to my previous question, not sure if it would help:
Cross domain file copy using VB.NET
you should be able to use your VB.NET solution translated to VBA
eg the LogonUser function declaration would be somethong like
Private Declare Function LogonUser Lib "advapi32.dll" _
(ByVal lpszUsername As String, _
ByVal lpszDomain As String, _
ByVal lpszPassword As String, _
ByVal dwLogonType As Integer, _
ByVal dwLogonProvider As Integer, _
phToken As IntPtr) As Boolean
精彩评论