Using VBA to sync files

Advertisement

mezentia
Joined:
Posts:
2
Location:
Smethwick, UK

Using VBA to sync files

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.

Reply with quote

Advertisement

mezentia

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?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Using VBA to sync files

mezentia wrote:

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?
The second link is about VBA. And the first is general, while using different languages, it can be translated to VBA too.
Last edited by martin on 2013-12-17; edited 1 time in total

Reply with quote

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.

martin wrote:

mezentia wrote:

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?
The second link in about VBA. And the first is general, while using different languages, it can be translated to VBA too.

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Using VBA to sync files

sy27295 wrote:

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.
That's just not true. The example at https://winscp.net/eng/docs/library_vb is well tested using various versions of Microsoft Excel.

What particular step are you having problem with?

Reply with quote

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

Reply with quote E-mail

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Using VBA to sync files

sy27295 wrote:

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'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.

Reply with quote

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.

Reply with quote E-mail

Advertisement

You can post new topics in this forum