How to convert a VB.Net Code into VBA

Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc used Ask the Experts™
on
I have an application in Ms access , now I want the code below which is in VB.Net to be converted into Ms Access VBA, kindly see how you can help.

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{41E07C9B-449E-4AF4-826E-00ACA3CF6254}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Debug|x64 = Debug|x64
		Debug|x86 = Debug|x86
		Release|Any CPU = Release|Any CPU
		Release|x64 = Release|x64
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|x64.ActiveCfg = Debug|x64
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|x64.Build.0 = Debug|x64
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|x86.ActiveCfg = Debug|x86
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Debug|x86.Build.0 = Debug|x86
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Release|Any CPU.Build.0 = Release|Any CPU
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Release|x64.ActiveCfg = Release|x64
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Release|x64.Build.0 = Release|x64
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Release|x86.ActiveCfg = Release|x86
		{41E07C9B-449E-4AF4-826E-00ACA3CF6254}.Release|x86.Build.0 = Release|x86
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {CE3F57D4-E30B-4512-926B-CC7D3BC8FB8B}
	EndGlobalSection
EndGlobal

Open in new window



Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software & Systems Engineer
Commented:
You have posted the .sln file...this contains nothing useful in terms of code...it is just describing how your application is organized for compiling.
There is nothing extraordinary about VB.NET <--> VBA...if it uses plain simple Visual Basic you can easily find the equivalent (although your above solution is C# and not VB.NET).
If it uses classes of .NET then you have to search how to do the conversion by examining the functionality of each and every one and finding similar if any.
Maybe your best bet is to create a .COM aware .NET .dll and use it in Access....check this tutorial : http://www.maxwellmckinnon.com/blog/2016/10/06/how-to-call-a-c-net-class-library-from-excel-vba-guided-example/
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
There is no simple conversion option. The only method is to read and understand the VB.NET code, then recreate the functionality in VBA - which may not be possible, as dotNET is so much more diverse and extended when compared to VBA.

Unless it is a simple function, you should regard this a paid job.
ste5anSenior Developer

Commented:
Strictly speaking: This is not possible, cause

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", [..]

Open in new window

There is no console application type in VBA.

Maybe you post the content of your pogram.cs. Depending on why you want to do this, you should consider running that application via shell or you migrate the console code to a PowerShell script. But as Gustav wrote, this is normally a job you hire someone for, cause it exceeds the scope of volunteer help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial