View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jean-Yves[_2_] Jean-Yves[_2_] is offline
external usenet poster
 
Posts: 253
Default Excel 97 - Common Dialog Control Help

Hi Russel,
You don't need to create it.
You can call the xl save as dialog box as follows
look for "GetSaveAsFilename"
Regards,
JY
Dim strNameToSaveAs As String
ChDrive ("R:\")
ChDir ("R:\cbt\")
'here you show the dialog
strNameToSaveAs =
Application.GetSaveAsFilename(InitialFilename:="St atistics",
FileFilter:="Microsoft Excel File (*.xls),*.xls")
'it return -but does nothing yet - the file name tho saveas
If strNameToSaveAs = "False" Then
Exit Sub
Else
ActiveWorkbook.SaveAs FileName:=strNameToSaveAs, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End If

"Russell Plummer" wrote in message
...
Trying to add the Save As dialog in Excel 97 VBA.

Have followed the instructions as per Richard Shepard's book, namely:
- Opened a blank user form
- Gone to Tools - Additional Controls
- Found Microsoft Common Dialog Control, Version 6.0 and ticked it
- Seen the Common Dialog icon appear on the Toolbox

When I dragged the Common Dialog tool over onto the blank form I got an
Error from Visual Basic saying "The Control could not be created because

it
is not properly licensed"

Can anyone offer any enlightenment?

Thanks

Russell