Manoj Chaurasia Posted September 24, 2012 Share Posted September 24, 2012 Hi Forum, I was attempting to run a macro code example given on the StatSoft developer's network. Here is the URL: http://sdn.statsoft.com/STATISTICAVisualBasic.aspxpage=method&class=Spreadsheet&item=VariableTextLabels&kind=sub 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: spr.VariableTextLabels(1,values(),labels(),descriptions()) 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 AGA206F367304A11-V Thanks to anyone who can set me straight on this. Cliff Here is the entirety of the code (copied from the URL above). Option Base 1 Option Explicit Sub Main() 'this example was written using the example data file heart.sta Dim spr As Spreadsheet 'assigns the active spreadsheet to the object spr Set spr = ActiveSpreadsheet Dim values() As Double Dim labels() As String Dim descriptions() As String 'place the text label values, labels, and descriptions into their 'respective arrays. spr.VariableTextLabels(1,values(),labels(),descriptions()) 'display the first text label parameters as returned above. MsgBox "Value = " + Str(values(1)) + vbCrLf + "Label = " + labels(1) + vbCrLf _ + "Description = " + descriptions(1), vbOkOnly, "Variable Text Label" End Sub Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted September 25, 2012 Author Share Posted September 25, 2012 Hi 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. Cliff Link to comment Share on other sites More sharing options...
Donald Johnson Posted April 3, 2019 Share Posted April 3, 2019 Link: http://sdn.statsoft.com/STATISTICAVisualBasic.aspx Is Broken. 404 Error. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now