I was attempting to run a macro code example given on the StatSoft developer's network. Here is the URL:
I loaded the recommended data set (Heart.sta) into a workbook along with the macro. When I run the macro, I get this message below. (the double quotes around the macro name are my own)
VBA Error in macro "Macro read variable text info" at line: 15
(10094) ActiveX Automation: Object var is 'Nothing'.
The line of code that appears to be in question is:
I am supposing that the code is somehow not understanding which variable to use??
The data set was set as the Active Input prior to my running the macro code.
I copied this code verbatim from the example at the URL (at least I thought I did) and ran it with the data set recommended in the example at the URL. What have I done wrong?
I am using Statistica 64 11
Thanks to anyone who can set me straight on this.
Here is the entirety of the code (copied from the URL above).
Your error lies in placing the spreadsheet and the macro as written into a workbook. Once you've done that, the dataset is no longer a stand-alone spreadsheet but is instead a workbook item. If you try leaving the dataset and the macro as stand-alone items, the macro should run (It does for me). Otherwise, you can change the statement Set spr = ActiveSpreadsheet to Set spr = ActiveDataset. This will allow you to run the macro from a workbook with a dataset also within the workbook. By making this change, I was able to run the macro with the dataset and macro in a workbook. I do hope that you find this information helpful. -Neptune
That's sort of what I suspected. Essentially 'pilot error' on my part due to being new to Visual Basic.
I really appreciate the help, and your patience with my learning curve. And also thanks for offering a really helpful knowledge base and forum.