Some links that can help with designing VBA to handle AutoCAD are below:
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:
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.
You have to configure two items in the installer as described below:
- Increase the Product Version number under General Information and then create a Upgrade Path if not done already.
- 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:
- Make changes in the project, test, and build
- Install using the setup.exe
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.
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.
After I deleted registry entries for a VSTO program, I used the regshot tool to compare the before and after.
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.
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.
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.