Certain common questions tend to recur.

Questions and answers

  1. I still use Office 2003 where did “Write Autocad Script” go?
    In Excel 2003 the command “Write Autocad Script” is an option in the Data menu.
  2. Can I use the Scriptsheets Add-In in a 64bit version of Office?
    No you can’t the Add-In is a 32bit COM-Addin and cannot be loaded in a 64bit Office version.
  3. I get the following error message:
    LoadLibrary(“…”) failed.
    GetLastError returns 0x0000007e
    You have obmitted double quotes or you have made a spelling mistake in the path to the Scriptsheets.dll.
    Correct syntax look something like this:Regsvr32.exe “c:/Program files/Scriptsheets/Scriptsheets.dll”
  4. I get the following error message:
    DllRegisterServer failed with error code 0x80004005
    Try registering the scriptsheets.dll with an elevated command prompt.
    Start| All Programs| Accessories|Command Prompt| right-click and choose Run as Administrator, then use regsvr32.exe
  5. #NAME? values show up in my sheet and scriptfile?
    Each scriptsheet workbook contains additional worksheet functions which are implemented as VBA macro’s.
    MS Excel uses security levels for macro virus protection. If the security level is set to high then macros are automaticlly disabled when a workbook is opened!
    Instead of the result of a perticular function cells which will show #NAME? you should change the security level for macro virus protection to medium.
  6. How do I make a block using a script file?
    Using a script file to select the objects that you created is the problem. However when you first open an empty drawing and than draw you block-entities, save the file and close it, you can later insert the file as a block.

    expert 2
    save mydrawing.dwg
    new .
    _circle 20,20 15
    expert 2
    save circle.dwg
    open mydrawing.dwg
    _insert circle=circle.dwg 0,0 1 1 0

  7. DTEXT command brings script to a halt?
    Using DTEXT in a script has problems and is a known AutoCAD defect logged against DID 107799 – DTEXT IS NOT SCRIPT COMPATIBLE. You can always use TEXT instead as shown in the sample script below. The blank lines are written to a script file when you use a semicolon “;” in the scriptsheet.

    _text _justify _mc 0,0 2.5 0
    First dtext line
    <blank line>
    <blank line>
    Second dtext line

  8. Is it possible use a VBA macro to write a scriptfile?
    Yes you can invoke the writescript method of the Scriptsheet object; following these steps:

    • In MS-Excel press Alt+F11 to start VBA environment
    • In the Tools menu choose References
    • Click the Browse button and add a reference the Scriptsheets.dll
    • Paste the following macro into a module

      Sub WriteAutoCADScript()
      Dim objectvar As Scriptsheets.AddIn
      ‘Create a new instance of the class

      Set objectvar = New Scriptsheets.AddIn
      ‘Run writescript method

      End Sub

    • Select worksheet containing the script program and run the WriteAutoCADScript macro to write a script.