Software/Excel Demo

From ZaberWiki
Jump to navigation Jump to search

This workbook was created to demonstrate the use of Excel Visual Basic (Excel VB) for the purpose of manipulating Zaber's T-Series line of computer-controlled products.

You can download the workbook, and there are instructions included. In it you will find:

Excel VB Tutorial
A brief introduction to VB for Excel
Cell Based VB Demo
Sending a list of instructions entered directly in the cells of an Excel sheet
Sheet Based VB Demo
A simple application created by placing standard VB controls on an Excel worksheet
Form Based VB Demo
The same application created on a userform executed from a single command button.

Problems with older workbooks

In late 2009, Microsoft released some updates to Windows that broke our sample Excel workbook. If your Excel macros stop working because you are still using our old workbook or Excel macros based on our old workbook, you have two choices: upgrade your workbooks, or upgrade some system files.

Upgrade your workbooks

If you were using our sample spreadsheet without any changes, or you wrote some simple macros based on our sample, we recommend you upgrade your code based on our new sample. Our new sample workbook doesn't require anything besides Microsoft Office, so it's easier to share workbooks with other users.

Upgrade some system files

If you don't want to upgrade your macros because you have a lot of them, you can make them work again by upgrading a library file on every user's computer that needs to run the macros. Finding the latest version of the library is a bit of a challenge, though. These instructions are based on this blog post by Tony Toews.

  1. Close any Microsoft Office programs.
  2. Download Microsoft Visual Basic 6.0 Service Pack 6 Cumulative Update from the Microsoft web site.
  3. Try to install it. This will only work if you have a copy of Microsoft Visual Basic 6 installed on the computer, so it will refuse to install on most computers.
  4. If it doesn't install, you have to manually extract a file from the msi installer.
    1. Try executing this on a command line:
      msiexec /a FileYouDownloaded.msi /qb TARGETDIR=DirectoryToExtractTo
    2. That should extract all the files from the msi file you just downloaded into the directory you specify. Look in that directory for the file MSComm32.ocx.
    3. If you can't extract the file that way, try installing the 7-Zip archiving utility. We found it could extract the msi file easily, and then extract the product.cab file inside that to find the MSComm32.ocx file we needed.
    4. Once you have the MSComm32.ocx file, copy it into C:\Windows\System32, or your equivalent system folder. Open a command prompt and manually register it using this command:
      regsvr32 mscomm32.ocx
  5. Once you have successfully upgraded MSComm32.ocx, try opening an Excel workbook that sends commands to a Zaber device. It should work now.

Some customers have reported getting an error, "License information for this component not found." If that happens to you, try installing our VB6 demo. That may update the license information properly.