I'm trying to get some information from SPSS using Win32::OLE. My problem is you need to pass a variant array of strings to the function, which is filled and returned. I'm using the following code:
This code works OK in SPSS Basic. In Perl the GetVariableColumnWidths function succeeds (LastError = 0 and $nvars returns the correct value) but nothing is returned in $cwidths.use Win32::OLE; $spssapp = Win32::OLE->GetActiveObject('SPSS.Application'); $data = $spssapp->Documents()->GetDataDoc(0); my $nvars = $data->GetVariableColumnWidths($cwidths);
I've experimented with creating $cwidths with Win32::OLE::Variant first using all of the following
none of which work. Can anyone help?my $cwidths = Variant(VT_BTSR | VT_ARRAY, ""); my $cwidths = Variant(VT_BTSR | VT_ARRAY | VT_BYREF, ""); my $cwidths = Variant(VT_VARIANT | VT_ARRAY, ""); my $cwidths = Variant(VT_VARIANT | VT_ARRAY | VT_BYREF, "");
Thanks,
Steve
In reply to SPSS from Win32::OLE by stevegr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |