Summary: You are using the Add method of the Forms collection to load a form. The code works correctly in the Visual Basic development environment, but fails with the following error when the application is made into an executable: Run-time error '-2147417848 (80010108)':
Automation error.

Resolution: Repairing FIX: Add Method of Forms Collection Fails in Executable problem can not be that easy. In order to fix your errors and speed up PC, it is recommended that your download the 'FIX: Add Method of Forms Collection Fails in Executable Repair Tool'. This is an advanced optimizing tool the can repair all those problems that are slowing your computer down.

Download FIX: Add Method of Forms Collection Fails in Executable Problems Fixer Now

In order to repair FIX: Add Method of Forms Collection Fails in Executable issue, use the SmartPCFixer software program. This system optimizer software is already proven to locate, identify, and fix FIX: Add Method of Forms Collection Fails in Executable errors. Your computer should run faster and smoother after using this software.

Method for Advanced Users

You can work around this problem by creating your own Forms collection. A reference to the form can be added to a collection, and keyed by the Form's name. This will let you load a form by specifying a text string and referencing the matching key field in the collection.

There are two options with this approach. You can pre-load the collection with a reference to all of the forms in the application at startup, which is the approach used in the following example. You may also load the forms into the collection as needed. There is slightly more programmatic overhead with the second approach, because you must check to see if the form is already in the collection. It is also important to note that adding the forms to the collection does not load the forms.

Steps to work around this problem are:
  • Start a new Standard EXE project in Visual Basic. Form1 is created by default.
  • From the Project menu, add a second form to the project.
  • From the Project menu, add a standard module to the project.
  • Add the following code to the code window of Form1: Private Sub Form_Click() Dim strFormToLoad As String strFormToLoad = "Form2" loadForm (strFormToLoad) End Sub Private Sub Form_Load() colForms.Add Form2, "Form2" End Sub
  • Add the following code to Module1: Public colForms As New Collection Public Sub loadForm(strFormName As String) Dim frm As Form Set frm = colForms(strFormName) frm.Show End Sub
  • Run the project and click on Form1.
  • Form2 should be loaded.
  • Stop the project.
  • Choose Make Project1.exe from the File menu.
  • Run Project1.exe, and click on Form1.
  • Form2 should load successfully.
  • What Else Does SmartPCFixer Offer You?

    Apart from fixing FIX: Add Method of Forms Collection Fails in Executable problems, SmartPCFixer is designed to provide the user's computer system with better optimization, which helps you manage startup items, desktop, browser objects, Internet, system service, Windows optimization, file extensions and so on. With these sophisticated utilities your system is tuned up to run at the optimal state.

    SmartPCFixer provides you with Registry Backup, System Backup, Favorites Backup and Folder Backup. In addition, the new built-in function of Restore Point enables you to create a system store point so you can recover your system to a previous state if you do not like the changes you have made. This ensures the safety of your system when you run the registry repair process.

    Related: 503 Service,Error 1075,Error Code 102,Error Code 21,Msi Error Code 1603
    Read More: ,BUG: FoxPro Math-Precision Problems with SET DECIMALS,BUG: Floppy Disks Created by PDW Repeats Prompt to Insert Disks With Visual Basic SP 4,BUG: WM_KEYDOWN Contains Extra Scan Code in wParam, in Journal Playback Mode,AR Customer History YTD Sales does not equal the total of the Period Sales Amt.,Adding the Salesperson ID and Sales Territory ID for each Document to the RM Detail Aged Trial Balance with Options