Tips to Fix Runtime Error Subscript Out of Range Solidwork Issue

Runtime Error Subscript Out of Range Solidwork
Runtime Error Subscript Out of Range Solidwork

Microsoft’s Visual Basic programming language is implemented in Visual Basic for Applications (VBA). VBA may be used to activate UDFs, automate processes, and gain access to WinAPI via DLLs.

However, there have recently been several instances of users being unable to run specific commands because they receive the error message “Subscript Out of Range, Error 9” when attempting to do so.

Microsoft VB run time error message

SOLIDWORKS makes use of Microsoft Excel by embedding or connecting an Excel-based table. In this post, you’ll discover fundamental troubleshooting procedures that can resolve Excel issues like “vba run-time error 9 subscript out of range”. The problem occurs when the software (excel) attempts to activate the embedded Solidworks worksheet.

Tips to Fix “Runtime Error Subscript Out of Range” Solidwork Issue

Diagnosing an object Linking and embedding (OLE) problems

You may identify OLE problems without using SOLIDWORKS by following the procedures shown below.

  1. Open WordPad by selecting “Start > Programs > Windows Accessories”.

Open WordPad

  1. Use the Insert Object>Create New>Microsoft Excel Worksheet command to embed an Excel spreadsheet as an OLE. This ought should launch Excel in a new window and enter a table.

Insert object create new Microsoft excel worksheet

  1. Save the WordPad file, then exit Excel.
  2. Double-clicking the Excel spreadsheet in the WordPad document should run Excel.
  3. Open WordPad and create a new document. The test WordPad document and Excel document should now be closed.

Retest after making sure that all Excel processes are terminated in Task Manager. Repair Microsoft Office if Excel is still not functioning. If the first time a file is viewed, the message “Failed to begin server program” appears.

  • Recheck your ability to access the spreadsheet from the word document after opening Excel. The OLE server’s registration is wrong if the Excel document opens, and Microsoft Office has to be reloaded.

If the second time a file is accessed, the message “Failed to initialize server program” appears.

  • Typically, an Excel operation running in the background is to blame for this. Excel is not closing down in this situation.
  • Any COM and Excel add-ins should be disabled.
  • Retest after closing Excel.

Excel options add-ins

  • Disabling XLSTART should be continued if the problem still exists.
  • Any files created in the XLStart folder should be disabled.
  • Disable trusted locations momentarily.
  • Retest after closing Excel.
  • If this fixes the problem, go to the Excel XLSTART folder, delete any files there, then try to see which one is to blame.

Excel options trust center settings

Switch on the “Optimized for Compatibility” option.

With this option selected, the display is optimized for twin monitor and docking station installations. To make this option available, follow the instructions below.

  1. Open Excel
  2. Choose Options in the green box on the left of the home page.

Excel home options

  1. Activate the option to “Optimize for Compatibility” under General > User Interface, then click “OK”.

Excel options general window

Switch off the alternate graphics device

When several graphics devices are present, SOLIDWORKS may experience a variety of problems. SOLIDWORKS Rx will be used to identify whether the problem is graphic-related. Launch SOLIDWORKS RX after closing SOLIDWORKS. By typing Rx into the Windows search box, you may access SOLIDWORKS RX.

There are two safe modes that may be utilized to aid with SOLIDWORKS problem diagnosis on the Home page of the Rx, at the bottom. Start SOLIDWORKS using OpenGL mode. With SOLIDWORKS running, this compels your CPU to do tasks that are typically performed by your GPU.

Launch solidworks in software openGL mode

Test Excel again to see if the problem still exists. If the issue has been resolved, it is a graphics-related issue. Now, identify the graphics hardware that is installed on your computer.

To accomplish this, open the Device Manager and expand Display Adapters. Check to see whether your graphics card and driver are supported if you only have one device or have previously deactivated switchable graphics.