- mezentia
- Joined:
- Posts:
- 2
- Location:
- Smethwick, UK
Using VBA to sync files
Advertisement
Can anyone provide me with an example of how to code file synchronisation from a remote device to a local directory using just VBA? I'm writing an Access 2010 app that needs to perform the synch automatically when the app loads - currently I'm doing this manually. I've seen some examples for putting files with FTP, but so far I can't work out how to create a similar function to do a local synch.
Advertisement
-
martin◆
Site Admin - Joined:
- Posts:
- 41,442
- Location:
- Prague, Czechia
Re: Using VBA to sync files
One of these may help you:
https://winscp.net/eng/docs/guide_automation_advanced
https://winscp.net/eng/docs/library_vb
https://winscp.net/eng/docs/guide_automation_advanced
https://winscp.net/eng/docs/library_vb
Using VBA to sync files
I've seen those two pages. I've downloaded and registered the VB.Net stuff, and I can add the reference to my Access application. However, VB.NET and VBA are different languages, and I can't see how to convert the VB.Net example to VBA :? Is there a VBA equivalent example for synchronising files?
-
martin◆
Site Admin - Joined:
- Posts:
- 41,442
- Location:
- Prague, Czechia
Re: Using VBA to sync files
The second link is about VBA. And the first is general, while using different languages, it can be translated to VBA too.I've seen those two pages. I've downloaded and registered the VB.Net stuff, and I can add the reference to my Access application. However, VB.NET and VBA are different languages, and I can't see how to convert the VB.Net example to VBA :? Is there a VBA equivalent example for synchronising files?
Last edited by martin on 2013-12-17; edited 1 time in total
- sy27295
- Joined:
- Posts:
- 11
- Location:
- Boston, USA
Re: Using VBA to sync files
I had the same issue.
As far as I know .... the winScp wrapper is for .NET interop; therefore, the Type Library object is not callable from Excel's Tools | Reference .... it can only be used from Visual Studio.
However, I still have this outstanding question ... what about the VBScript (sample + presumably/actually working code). Creating a COM Object from (pure) VBA and VBScript is pretty much the same thing.
As far as I know .... the winScp wrapper is for .NET interop; therefore, the Type Library object is not callable from Excel's Tools | Reference .... it can only be used from Visual Studio.
However, I still have this outstanding question ... what about the VBScript (sample + presumably/actually working code). Creating a COM Object from (pure) VBA and VBScript is pretty much the same thing.
The second link in about VBA. And the first is general, while using different languages, it can be translated to VBA too.I've seen those two pages. I've downloaded and registered the VB.Net stuff, and I can add the reference to my Access application. However, VB.NET and VBA are different languages, and I can't see how to convert the VB.Net example to VBA :? Is there a VBA equivalent example for synchronising files?
Advertisement
-
martin◆
Site Admin - Joined:
- Posts:
- 41,442
- Location:
- Prague, Czechia
Re: Using VBA to sync files
That's just not true. The example at https://winscp.net/eng/docs/library_vb is well tested using various versions of Microsoft Excel.I had the same issue.
As far as I know .... the winScp wrapper is for .NET interop; therefore, the Type Library object is not callable from Excel's Tools | Reference .... it can only be used from Visual Studio.
What particular step are you having problem with?
- sy27295
- Joined:
- Posts:
- 11
- Location:
- Boston, USA
Re: Using VBA to sync files
What I was trying to say....
VBA without the .NET framework
VBA from within Excel (or any other Office Module; no framework, no VisStudio)
VBA that could be used in Win '95, etc... before .NET Office Interop was created
I think that's where the confusion was
Cornelia
VBA without the .NET framework
VBA from within Excel (or any other Office Module; no framework, no VisStudio)
VBA that could be used in Win '95, etc... before .NET Office Interop was created
I think that's where the confusion was
Cornelia
-
martin◆
Site Admin - Joined:
- Posts:
- 41,442
- Location:
- Prague, Czechia
Re: Using VBA to sync files
I'm not an expert in this. But I believe that this has nothing to do with .NET Office interop. WinSCP .NET assembly is COM library, no matter if it is implemented using .NET framework. So as long as you have .NET framework (so that the assembly can execute), no support on Excel-side is needed for .NET. From Excel perspective, the assembly is COM library as any other. But of course .NET framework is not supported on Windows 95.What I was trying to say....
VBA without the .NET framework
VBA from within Excel (or any other Office Module; no framework, no VisStudio)
VBA that could be used in Win '95, etc... before .NET Office Interop was created
- sy27295
- Joined:
- Posts:
- 11
- Location:
- Boston, USA
Re: Using VBA to sync files
>>>I'm not an expert in this. <<<
Ok, ok .... now got it.
Looks like the automation DLL does not do pure VBA.
Just for your info.... there are and will be some questions about VBA (outside of the .NET Assembly usage). It is very easy to see what it is.... Open Excel, Hit Alt-F11 .... there it is, VBA environment without the Framework.
Some people may be talking about this, when they say VBA.
Ok, ok .... now got it.
Looks like the automation DLL does not do pure VBA.
Just for your info.... there are and will be some questions about VBA (outside of the .NET Assembly usage). It is very easy to see what it is.... Open Excel, Hit Alt-F11 .... there it is, VBA environment without the Framework.
Some people may be talking about this, when they say VBA.
Advertisement
You can post new topics in this forum