Hello every one,
Please help. I am trying to display the saveas dialogue box but is giving me an "object required" error in "CommonDialog1.ShowOpen" even though, I already have Common Dialog OCX in the toolbox, what's missing? Thank yo
A. Haj
Hello every one,
Please help. I am trying to display the saveas dialogue box but is giving me an "object required" error in "CommonDialog1.ShowOpen" even though, I already have Common Dialog OCX in the toolbox, what's missing? Thank yo
A. Haj
Ok but what does your code look like. Seeing that may shed light on your plight.
David
Thank you David, here is the code:
The error "object required" is in "CommonDialog1.ShowSave"
Private Sub cmdSave_Click()
On Error GoTo errhandler
CommonDialog1.CancelError = True
' Display the Save dialog box
CommonDialog1.ShowSave
CommonDialog1.Filename = ""
Exit Sub
errhandler:
Select Case Err
Case 32755 ' Dialog Cancelled
MsgBox "You cancelled the dialog box"
Case Else
MsgBox "Unexpected error. Err " & Err & " : " & Error
End Select
End Sub
You are clearing the filename
Try
Code:Dim strFile as String Me.CommonDialog1.ShowSave strFile = Me.CommonDialog1.FileName msgbox strFile
OK David, I tried that, now it's giving me "Method or data not found", it sounds like it's not recognizing "CommonDialog1", thanx.
Silly question but you have actually added the common control dialog activeX control to the form haven't you?
David
Thank you David, that's not a silly question, actually great one, I thought I did and I just rechecked my toolbox components window and did not see it there, so now am not sure, what to do? Thanks a bunch David.
A. Haj
David,
Because of your question, I tried to add the common control dialog activeX control to the form but gave me this error " You do not have a license to use this control", so I folllowed the instructions on this link,
http://support.microsoft.com/kb/318597
and installed it successfully but now it still gives me the "object required" error in CommonDialog.ShowSave or the "Method or data member not found" error in Me.CommonDialog.ShowSave, it does the same if you use CommonDialog1.ShowSave, thanks alot.
A. Haj
David,
I went to the properties window of the common control dialog activeX control on the form and found that the OLE Class is CommonDialog and the Name was CommonDialog4 so I changed it to CommonDialog and success, it worked, thank you.
A. Haj