Question error: Name 'GlobalScope' is not declared

bandit1684

New member
Joined
May 1, 2011
Messages
3
Programming Experience
Beginner
I have OOo running in a VB program I built.
I am new to VB and especially new to using OpenOffice.

I am getting the error: "Name 'GlobalScope' is not declared" and have not been very successful researching online or in books.
I am getting this error on line: GlobalScope.BasicLibraries.LoadLibrary("Tools")
I am Using a code i found online

'Opens a Open File Dialog to allow the end user to select a file to import into the program.
'This code is from Andrew Pitonyak's free Useful Macros book
Dim fOpenFile As String
Dim oFileDialog As Object
Dim iAccept As Integer
Dim sPath As String
Dim InitPath As String
Dim oUcb As Object
Dim filterNames As String

filterNames = "*.*xls"

GlobalScope.BasicLibraries.LoadLibrary("Tools")
oFileDialog = CreateUnoService("com.sun.star.ui.dialogs.FilePicker")
oUcb = CreateUnoService("com.sun.star.ucb.SimpleFileAccess")

'Set your initial path here!
InitPath = ConvertToURL("C:\")

If oUcb.Exists(InitPath) Then
oFileDialog.SetDisplayDirectory(InitPath)
End If

iAccept = oFileDialog.Execute()
If iAccept = 1 Then
sPath = oFileDialog.Files(0)
fOpenFile = sPath
End If
oFileDialog.Dispose()



Any help or ideas would be greatly appreciated.
 
Thank you for the reply.

I have read what you said all over the place online but I have yet to come across anything that will fix the error.

My full code is attached if it will help any
 

Attachments

  • code.txt
    356 KB · Views: 27
Back
Top