Helpful VBA/ActiveX AutoCAD Links

Some links that can help with designing VBA to handle AutoCAD are below:

Iterating through layer collections

Delete all objects in a layer

How to copy all objects from one drawing to another in autocad through VBA

Share Button

The New Office Add-in helpful links

After researching and finding some good information on the new office add-in I have found the following links that will help anyone in designing them:

Build your first excel add-in

Excel JavaScript API

Excel JavaScript API in detail

VSTO vs JavaScript API

Office UI Fabric

GitHub Library of Office UI Fabric with coding examples

Inserting Images Word Only

Other options with JavaScript API for Word only

Share Button

How to deal with files with a name longer than 259 characters?

Image

The fileinfo class that is the standard class to use for getting fullname of a file will produce an error when the path is too long. This is a path that windows allows but the class can’t handle the error. More on the subject is described here.

After much research I installed the nuget package ZetaLong Paths. Just searched for it and chose the appropriate file as shown below.

The article that pointed me to the solution can be found here. It also lays out some alternative methods.

After I installed the package I was able to use fileinfo methods such as fullname without any path too long error. Just change fileinfo to ZpFileInfo for methods using fileinfo.

Share Button

Update a Visual Studio Project After Installing it using Windows Installer Method

You have to configure two items in the installer as described below:

  1. Increase the Product Version number under General Information and then create a Upgrade Path if not done already.
  2. Change the Product Code.

Now you can do the following steps below.

In order to update a project after it has been installed follow the procedure below:

  1. Make changes in the project, test, and build
  2. Install using the setup.exe
Share Button

System Software Requirements InstallSheild

When creating an installshield project in visual studio you may want to have a requirement that another visual studio project must be installed. Since the other installshield project has specific registry entries specified, you can define this requirement under the section “5. Define Setup Requirements and Actions > Requirements”. Make sure when you create this requirement to specify the value. Without it it will use default which is typically null. It is also described in detail here.

Share Button

Type library exporter encountered generic type Error Meaning

When building my VSTO project I got the following error: ”
Warning Type library exporter warning processing ‘HplAddinAGSL.Agslo.GetFilesToOpen(#0), HplAddinAGSL’. Warning: Type library exporter encountered a generic type instance in a signature. Generic code may not be exported to COM. AGSLo ”

This stems making the VSTO COM visible and the type being using for this function was from systems.collection. In the function with the error I am using List<string> which may not be exported to COM. More research is needed at this point to correct the warning.

Share Button

Registry Comparing Tool

After I deleted registry entries for a VSTO program, I used the regshot tool to compare the before and after.

Share Button

How to access app.config from VBA that uses a VSTO

When I started testing my VSTO from a VBA button, the function that reads from the app.config broke. I knew that the VBA was not able to access the app.config since my default null value was being returned, but did not know how to fix it.

After trying multiple approaches, the one approach that works is found here.

Share Button

Creating a custom icon for windows forms

The blog post here describes what program to install and how to create the icon. Then once created I saved it into a Icon folder in the project file.

Share Button

Visual Studio Crashed and my .cs file for a windows form was corrupted

So my visual studio ended up crashing due to my hard drive dying. Unfortunately the work I had completed yesterday to my form was corrupted. Luckily I had a backup and then performed a beyond compare on the designer.cs file. I took all of the new buttons and then had to fix any errors when I opened the file due to the code in the .cs file not being there. Also to be noted I could not use the original .cs file since I was full of nulls. I just took in the old one.

Share Button