How to get the path of the active app.config file in C# and VB.NET

To get the path of the active app.config file in C# and VB.NET you can use the following snippet

Sample C#

AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;

Sample VB.NET

AppDomain.CurrentDomain.SetupInformation.ConfigurationFile

Please rate this snippet

How to create and write a textfile in VBA

To create and write a textfile in VBA you can use the following snippet.
This should also work when using VB6.

Sample VBA

Dim fso as Object
Dim oFile as Object

Set fso = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.CreateTextFile("C:\Users\Codesnippets\Desktop\Test.txt")

oFile.WriteLine "This is a sample line!" 
oFile.Close

Set fso = Nothing
Set oFile = Nothing  

Please rate this snippet