FileDialog Object for Excel 2000?
Hi,
I was wondering how do I make the FileDialog Object available for Excel 2000?
I understand it needs the Microsoft Office II.0 Object library, but to my understandings isn't available for Excel 2000 or earlier. Is there any replacement I can use if FileDialog is not available?
I understand there is an Application.Dialog object, but how do I access the filename and path from this object?
Any help would be apprecaited. Thanks!
Re: FileDialog Object for Excel 2000?
You can use the GetOpenFileName and GetSaveAsFileName dialogs from at least Excel 97+. Which dialogs are you in need of?
Re: FileDialog Object for Excel 2000?
Hi Rob,
I need to use the getopenfile object. thanks! I guess I can try to search it through msdn, but meantime can you help me on how to use it? Specifically the properties such as directory and filename. Thanks!
Re: FileDialog Object for Excel 2000?
No problem. ;) I know MSDN can be a pain to search. :)
Here is a quick example.
VB Code:
'Application.GetSaveAsFilename "InitialFileName", "FileFilter", "FilterIndex", "Title", "ButtonText4MacintoshOnly"
Dim sFileName As String
sFileName = Application.GetSaveAsFilename("C:\Test.xls", "Excel Workbooks Only (*.xls),*.xls", 1, "My Save As Dialog")
ActiveWorkbook.SaveAs sFileName '"C:\Test.xls"
ActiveWorkbook.Saved = True 'Prevents the prompting to save the current workbook since we savedas.
[RESOLVED] FileDialog Object for Excel 2000?
thank you very much! have a nice day
Re: FileDialog Object for Excel 2000?
Thanks for saying Thanks. ;) Dont get too many of those. :thumb:
Re: FileDialog Object for Excel 2000?
Hi I am having a similar issue with Excel 2000. But I need to get a folder.
Thanks
Re: FileDialog Object for Excel 2000?
Use the same but save a file into the required destination. Then strip off the filename part of the filepath and name.
Instrrev and left functions should do it. Read up on those.
Re: FileDialog Object for Excel 2000?
Search the forums for BrowseForFolder. Its an API solution but you only need to place it into a Module and then call as a function.