Stefano Grazioli

Here you will find solutions to many critical errors. Follow the steps closely to increase your chances of a successful outcome.



"Unable to find code signing certificate"

If you see an error message similar to the one above, there is an easy solution

  • Turn on Visual Studio
  • In the solution explorer, right-click on the project (square icon, 'VB' inside) > Properties > Signing > Create Test Certificate >  leave empty  (you do not need a password) > OK
  • Close the project window
  • In the top tab in VS, go to Build > rebuild solution
    Done!

"User input box has wrong title"

  • Add a second parameter to the code that creates the input box. That will be the title.
    InputBox(prompt, [title], [default])
    prompt: This is the message displayed in the input box. It's a required parameter.
    title: This sets the title for the input box (use double quotes). If omitted, the application name is used.
    default: This is the default response that appears in the text box. If omitted, the text box is empty

"Where is my desktop?"

Windows has two desktops.  They look identical. But they are quite different. This can be confusing.

  • One is the LOCAL desktop.  Local means that it is saved on the computer you are working on. Each computer has a different local desktop. If you save your files on the desktop of one computer you will not see those files on the desktop of another computer.
    The local desktop is
    C:\Users\<yourComputingID>\Desktop
  • The other desktop is a virtual one. It is stored in your OneDrive. You can retrieve your virtual desktop and its contents from any computer.
    C:\Users\<YourComputingID>\OneDrive\Desktop
    Sounds like a good idea, except that VS does not like to work off remote folders. So, while you work with VS, it is a good practice to save your project folders on your LOCAL desktop. When you are done, copy them on Box, Dropbox, Google drive or similar, so they are easy to retrieve from any computer.

    If you want to turn off the OneDrive virtual desktop feature, try to do the following - you might not be able to do them on a lab PC :
  • Open OneDrive Settings: Click the OneDrive cloud icon in the system tray (bottom right corner of your screen) and select "Settings."
  • Unlink Your PC: Go to the "Account" tab > click "Unlink this PC."
  • In the settings window, under the "Settings" tab, uncheck "Start OneDrive automatically when I sign in to Windows."
  • Close OneDrive: Right-click the OneDrive icon in the system tray again and select "Close OneDrive."

Cannot start VS /  Blue Screen / Fatal Errors and Crashes

This is a bad one. Follow exactly the steps for maximum chances of recovery.  If you try accurately a couple of times and it does not work, move to another computer.

  • Quit VS
  • Make sure that you have no instances of Excel running.  Press Alt+Ctrl+Del at the same time.  Select Task manager.  Scroll for running excel programs.  If you find any, right click and end them all 
  • Start Excel, open a new blank workbook.
  • Go to Options > Add ins > Excel Add Ins > Go > Uncheck all except anything that relates to Visual Studio or VBA > OK
  • Go to Options > Add ins > Com Add Ins > Go > Uncheck all > OK
  • Go to Options > Add ins > Com Add Ins > Go > Check anything the relates to Visual Studio or VBA > OK
  • Go to Options > General > optimize for compatibility
  • Quit Excel
  • Start VS. Create a NEW VSTO workbook.  Settings are VBA, Windows, Office and Workbook.  Location: either the default or your desktop. 
  • In VS go to Tools > Options > General and uncheck "Optimize rendering for screens..."

    Done!  It is not guaranteed to succeed, but it has a good success rate.


"This file could not be accessed"

This is an easy one.

  • Quit VS
  • Make sure that you have no instances of Excel running.  Press Alt+Ctrl+Del at the same time.  Select Task manager.  Scroll for running excel programs.  If you find any, right click and end them all 
  • Start Excel, open a new blank workbook.
  • Go to File > Options > Add ins > Excel Add Ins > Go > Uncheck all except anything that relates to Visual Studio or VBA > OK
  • Go to File > Options > Add ins > Com Add Ins > Go > Uncheck all except anything that relates to Visual Studio or VBA > OK
    Done!

"This file/folder cannot be trusted" (or similar)

You need to make the folder where you save your projects a "trusted" location.

  • Quit VS
  • Open a blank Excel workbook.
  • Go to File > Options > Trust Center > Trust center settings > Trusted Locations
  •  Add new location (the folder you want to be trusted) > check the sub-folder option > OK
    If you work on your desktop, meaning if your project is saved on your desktop and you run it unzipped there, then the folder to trust is C:\Users\<yourUVAuserID>\Desktop

Done! But you will need to repeat this for all computers on which you work. You trust a specific folder on a specific PC. If you change PC, the equivalent folder (same name) is not trusted.


"My work is saved on a computer I cannot access: somebody else is working on it"

  • If you saved partial work in myCommSite, retrieve it form there, else you need to wait until to regain access to that specific PC
  • While you work with VS, it is a good practice to save your project folders on your LOCAL desktop. When you are done, copy them on your favorite remote location: e.g., Box, Dropbox, Google drive, or similar, so they are easy to retrieve from any computer later.

Errors working in lab 300 - Cannot connect

  • Lab 300 works on a different technology than the other labs.  Good news: there is an easy solution: just go to another lab.

Maximum call stack size exceeded

  • THis typically happens when there is an infinite loop of some sortthatfills up all avialable memory onyour computer
  • If you see this in ADS, quit and restart.
  • If you see this in VS, stop the program, figure out where is the loop, and modify it so that it is not infinite (example: Sub A calls Sub B that calls Sub A....).