I need a way to pass a variable from VBA
to C# app , The variable will be a string (a path) which will be used as a parameter in C# method (zip and unzip) .
Example :
My VBA
code in ms access :
Dim strSource,strDest,strPwd as string
strSource = CurrentProject.Path & "\AnyFolder"
strDest = CurrentProject.Path
strPwd = "BlaBla"
My C# Method would be like :
void UnZipMe()
{
string MyZip = VBA.strSource;
string UnzipAt = VBA.strDest;
string MyZipPass = VBA.Pwd;
using (ZipFile archive = new ZipFile(MyZip))
{
archive.Password = MyZipPass;
archive.Encryption = EncryptionAlgorithm.PkzipWeak;
archive.StatusMessageTextWriter = Console.Out;
archive.ExtractAll(UnzipAt, ExtractExistingFileAction.Throw);
}
}
I could save VBA variable value in a table then get it from C# using OLEDB
but i'm trying this way , Can it be done simply or just go for storing the values in access tables? thanks.