There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
VBA - Office.Filedialog doesn't work


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
Scanerman's Avatar
Member with 50 posts.
 
Join Date: Oct 2002
Location: Coventry, UK
30-Jun-2005, 09:13 AM #1
VBA - Office.Filedialog doesn't work
Can somebody out there help me.

I've written and tested an application that opens a .txt file, processes it in XL to re-order the columns and strip duplicates and saves it as .csv. All works fine on my system which has Microsoft Office 10.0 Object Library.

Problem is when I run it on nother machine which has Microsoft Office 9.0 Object Library I get an object undefined error at my definition line

Dim FileDlg as Office.FileDialog

I have checked that Microsoft Office 9.0 Object Library is ticked in the references dialog for the project.

Looking in more detail when I enter "Office." in my module and look in the pull down list FileDialog is not there.

So I need to look at either alternative code to allow the user to select the source data file, or a way to replace the existing FileDialog object on the older machine.

Any ideas anybody?
Scanerman's Avatar
Member with 50 posts.
 
Join Date: Oct 2002
Location: Coventry, UK
05-Jul-2005, 08:56 AM #2
OK after a bit of messing about I've found that the FileDialog object exists in MSO.dll (v10.0) but not in MSO9.dll.

I've been able to switch between MSO.dll and MSO9.dll on my system running Win2000, but on a system running Windows XP with Office 2000 it corrupts Office when I try and install MSO.dll (v10.0). Attempting to start Excel starts an install wizard asking for the installation disk.

I copied MSO.dll to the same folder as MSO9.dll then renamed MSO9.dll as MSO9.bak. I had to do a system restore to get Office to work again after that. With MSO9.dll still in place however the VBA project references re-set to v9.0 each time I closed the References dialog.

So I still need a way to use Office.Dialogs on a system that currently has the Microsoft Office 9.0 Object Library.

Can anybody help?
talstog's Avatar
Junior Member with 2 posts.
 
Join Date: Jul 2005
19-Jul-2005, 08:21 PM #3
Exclamation FileDialog for VBA on Office 97
Take a look to:

mvp-access.com/accessvbafaq/item.asp?pagina=44

it's in spannish, but there you have a zip file (at the very bottom) that contains a Class Module that acts as a FileDialog but it's written to be used on Office 97 (without the need of the 10 Object Library)
Remember to mark as reference
Microsoft Visual Basic for Applications Extensibility 5.x

AND IT WORKS!! :-) (I had the same problem few days ago :-)

The zip contains the module and an example.

Hope it helps.

BTW. I just sign to post the solution, but there is a filter that does'nt allow to newbies to post URL . I hope you will be able to read the URL and that it will not be filtered
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:32 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.