Message 1 of 9
Find Workgroups in VB express

Not applicable
12-27-2010
11:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dim oFileLocations As FileLocations oFileLocations = oInvApp.FileLocations ' Display the workspace. 'Debug.Print("Workspace: " & oFileLocations.Workspace) Dim asNames() As String Dim asPaths() As String ' Get the list of workgroup paths. Dim iNumWorkgroups As long 'Call oFileLocations.Workgroups(iNumWorkgroups, asNames, asPaths) Call oFileLocations.Workgroups(iNumWorkgroups, asNames, asPaths) If iNumWorkgroups > 0 Then Debug.Print("Workgroup Paths") ' Iterate through the list of workgroups. The array is filled ' zero based, so the iteration begins a zero. For i = 0 To iNumWorkgroups - 1 Debug.Print(" " & asNames(i) & " = " & asPaths(i)) If asPaths(i) = asPaths(2) Then sFilePath = asPaths(2) + "\" Debug.Print(sFilePath)
the attached code works fine with VBA.... how do i get it to work in VB express? the problem is in asNames and asPath are giving a Null reference.
Thanks,
Bill