Excel VBA Training Tutorial

add-vba-code

Hello everyone, hope you are doing fine. This tutorial is about learning Excel VBA in a short span of time. Recently I got involved in some organizational internal work where I had to do some Automation task using Excel Macro. Also I was being told to tutor what I had learnt. So I personally made this presentation which is full of examples and good to have a start in Excel VBA learning. So here goes the link below.

ExcelVBA_Macros_TrainingTutorial

Please email or send me your feedback about the same and I will be more than happy.

Wix Creation Magic tool…coming soon

Recently I was working on an idea to work upon or create a Wix Project Template that can be added in any solution which will come with a wizard which will take all the mandatory inputs as parameters and generate the Wix XML by itself. It will also do the task of building and publishing the projects inside the solution. The Directory Structure will be created by itself.

So watch out …I will soon publish a video tutorial of how to use that Project Template and a link to the .vsix installer.

Coming-Soon

Publishing Web Application Projects

Recently I was working in a value addition where there was a requirement of publishing WebApplication. I initially tried with searching of some form of aspnet_compiler API and found something like below.
————————————————————————————
string msPath = @”C:\Windows\Microsoft.NET\Framework\v4.0.30319″;
string msCompiler = “aspnet_compiler.exe”;
string fullCompilerPath = Path.Combine(msPath, msCompiler);

ProcessStartInfo process = new ProcessStartInfo
{
CreateNoWindow = false,
UseShellExecute = false,
RedirectStandardOutput = true,
WorkingDirectory = msPath,
FileName = fullCompilerPath,
Arguments = string.Format(“-p {0} -v /{1} -f {2}”, “\”” + solutionFileDirectory + strProjectPath + “\””, “/Web”, “\”” + txtBuildPath.Text + “\””)
};
Process p = Process.Start(process);
string output = p.StandardOutput.ReadToEnd();
——————————————————————————–
But there is  requirement of adding modification of the output after aspnet_compiler is done with such as adding global.asax, deleting unwanted folders etc.So you need to add custom code to make those modification.
It is really a mundane task and also the output is also not perfect.

Recently I have found out a way to publish web application by writing some custom code of my own and then creating an exe out of a console application. You can create this by simply creating a console application and copy paste the entire code in the main method. BTW below namespaces are used to create this app. Also you need to add the below references.

Microsoft.Build.Engine
Microsoft.Build.Framework
using Microsoft.Build.BuildEngine;
using System.IO;
————-CODE TO BE PUT INSIDE MAIN METHOD—————

try
{
string solutionFilePath = args[0];
string strBuildPath = args[1];
if (Directory.Exists(strBuildPath))
{
string[] filePaths = Directory.GetFiles(strBuildPath);
string[] folderPaths = Directory.GetDirectories(strBuildPath);
foreach (string filePath in filePaths)
{
File.Delete(filePath);
}
foreach (string folderPath in folderPaths)
{
Directory.Delete(folderPath, true);
}
}
else
{
Console.WriteLine(“Please enter Valid publish and build path”);
}
Engine objEngine = new Engine();
objEngine.BinPath = @”C:\Windows\Microsoft.NET\Framework\v4.0.30319″;
FileLogger logger = new FileLogger();
logger.Parameters = @”logfile=C:\temp\build.log”;
objEngine.RegisterLogger(logger);
BuildPropertyGroup objBuildPropertyGroup = new BuildPropertyGroup();
objBuildPropertyGroup.SetProperty(“Configuration”, “Release”);
objBuildPropertyGroup.SetProperty(“OutputPath”, strBuildPath);
bool success = objEngine.BuildProjectFile(solutionFilePath, new string[] { “Rebuild” }, objBuildPropertyGroup);
try
{
string[] pathDir = solutionFilePath.Split(‘\\’);
string folderName = pathDir[pathDir.Length – 1].Replace(“csproj”, “”);
string strPublishPath = Path.Combine(strBuildPath, “_PublishedWebsites”, folderName);
string[] filePaths = Directory.GetFiles(strBuildPath);
string[] publishedFilePaths = Directory.GetFiles(strPublishPath);
string[] publishedFolderPaths = Directory.GetDirectories(strPublishPath);
foreach (string filePath in filePaths)
{
File.Delete(filePath);
}
foreach (string fPath in publishedFilePaths)
{
File.Move(fPath, Path.Combine(strBuildPath, Path.GetFileName(fPath)));
}
foreach (string dirPath in publishedFolderPaths)
{
Directory.Move(dirPath, Path.Combine(strBuildPath, new DirectoryInfo(dirPath).Name));
}
Directory.Delete(Path.Combine(strBuildPath, “_PublishedWebsites”), true);
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
success = false;
}
if (success)
{
Console.WriteLine(“Publishing Completed Successfully”);
}
else
{
Console.WriteLine(“Publishing Failed”);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

————————————————————

Presentation on Windows Server 2008 Network Load Balancing and Failover Clustering

These features of Windows Server 2008 might look similar and also creates a point of confusion for many. Well, Implementation of Network Load Balancing is all about improvising performance, providing scalability while failover clustering addresses uptimes mitigating System Failures. You will mainly find NLB Implemented Web Front End/ Application Servers and Failover Clustering at database level. Configuring and set up these two are in the servers are also different.

NLB_FOBNetwork Load Balancing(NLB) in short is best used in cases where multiple servers may run the same services without affecting each other and any changed data is passed through to another service completely.Mostly Web Front End Servers.

Failover Clustering is best used in cases where Shared Storage is in use and only one service may run at a time for mainly data integrity reason. Mostly Database servers.

We use NLB to create a group of identically configured web-app servers all of whom talk to a clustered database server.

Here goes a presentation on Windows Server 2008 Network Load Balancing and Failover Clustering that I have prepared . Please let me know if you are going to need this in ppt format, Just drop me an email for the same.

Video tutorial Coming Soon. Please check for Update from the blog.

NLB_FOC_W2K8

A very useful Good Tutorial from Ed Liberman on TCP/IP

Well the logic  written behind this screen is simply huge. You will understand it when you will understand the concepts behind IP Addressing..

IPAddressing

I found this a very good tutorial on TCP/IP by obviously my favorite Ed Liberman. All you need to remember to work with TCP/IP you can find it inside and within one hour.

Here it goes.

TCP/IP in one hour