View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
inquirer inquirer is offline
external usenet poster
 
Posts: 74
Default "Could not locate some objects...."

Further to my enquiry, I think the problem is a "Commondialog" control. I
originally got this from a website but have since mislaid the reference. I
recall I had to set a additonal control to Toolbox/Controls but can't
remember how. Perhaps someone knows of the website and could point me to it?

The code which works fine on the desktop pc (excel 2002) is :
Private Sub CommandButton1_Click()
bOK = True
Me.Hide
End Sub
Private Sub CommandButton2_Click()
bOK = False
Unload Me
End
End Sub
Private Sub CommonDialog2_Enter()

End Sub
Private Sub UserForm_Initialize()
Dim d1 As String
d1 = CurDir
TextBox26.Value = d1
ChDir d1
End Sub
Private Sub chngDir_Click()
Dim sMyNewDirectory As String
Dim stempdir As String
dirSelect.Show
stempdir = CurDir
On Error Resume Next
CommonDialog2.DialogTitle = "BROWSE to the datafile directory, double
click on it and press SAVE"
CommonDialog2.InitDir = app.path
CommonDialog2.Filename = "DOUBLE CLICK on directory then press SAVE"
CommonDialog2.flags = cdlOFNNoValidate + cdlOFNHideReadOnly
CommonDialog2.Filter = "Directories|*.~~~"
CommonDialog2.CancelError = True
CommonDialog2.ShowSave
If Err < 32755 Then
sMyNewDirectory = CurDir
End If
ChDir stempdir
TextBox26.Value = sMyNewDirectory
End Sub
Private Sub GetstkFile()
CommonDialog1.InitDir = TextBox26.Value & "\"
CommonDialog1.DialogTitle = "Saved file name"
CommonDialog1.Filter = "File name (*.xls)|*.xls"
CommonDialog1.DefaultExt = ".xls"
CommonDialog1.ShowOpen
TextBox25.Value = CommonDialog1.Filename
End Sub
Private Sub browseSF_Click()
GetstkFile
End Sub
Private Sub dirSelect_Click()

End Sub


Thanks
Chris