fileDialog object errors in windows 10 and/or office 2016 (1 Viewer)

vba_php

Forum Troll
Local time
Today, 11:54
Joined
Oct 6, 2019
Messages
2,880
I've just run on a test on this little object and its properties because it was behaving horribly for my last little gig, and this is what I'm seeing it do in windows 10:

If I declare it appropriately in ACCESS:
access_fd_declare.jpg


and then I set the properties appropriately:
access_fd_spec_dir_loc.jpg


It actually opens to this directory!
access_fd_actual_dir_open_loc.jpg


Not only that, but it doesn't even list the right file extensions I asked for:

access_fd_file_types_shown.jpg


this also happens in Excel if I want only ".XLS" files:
excel_fd_file_spec_XLS_only.jpg


then it gives me every file type, regardless of extension:
excel_fd_file_types_shown.jpg


and for further annoyance, even though I only want ".XLS" files, it gives me every excel extension too!
excel_fd_file_types_shown_ALL_XL_EXTS.jpg



anyone else have this going on?
to make this even stranger, the customer says they encounter no errors, everything opens to the right place and there is no problems. and they are running both 2007 and 2010 office products and an older versions of windows. is this possibly an issue that is caused by the "C:\" directory being restricted by newer versions of windows in terms of what you can do in code when interacting with the root dir of C:\???
 

isladogs

MVP / VIP
Local time
Today, 17:54
Joined
Jan 14, 2017
Messages
18,211
Never had the problem you describe.
Try enabling file suffixes in Explorer just in case that helps. You never know.
 

vba_php

Forum Troll
Local time
Today, 11:54
Joined
Oct 6, 2019
Messages
2,880
no go, Colin. thanks anyway! it still shows the wrong files... =(

no_go_on_file_exts.jpg
 

isladogs

MVP / VIP
Local time
Today, 17:54
Joined
Jan 14, 2017
Messages
18,211
Suggest you upload all the code used ... and does the code compile
 

vba_php

Forum Troll
Local time
Today, 11:54
Joined
Oct 6, 2019
Messages
2,880
are you sure you have the time to look at it? well, if you want too, here it is for both the excel request and access request....

the XLSX file is the one I was complaining about here. and the access ACCDB file is the primary request. this problem is happening in both files. the code from both programs is included in both the TXTs but the actual programs sent to the customers are in the zip files. if you have time, let me know what i've done wrong if you could. and yes, all the code compiles in the vba editor in both programs. thanks!
 

Attachments

  • source files for import.zip
    546.6 KB · Views: 68
  • excel vba code used.txt
    5.8 KB · Views: 81
  • access vba code used.txt
    7.4 KB · Views: 79
  • customer excel package.zip
    550.7 KB · Views: 78

GinaWhipp

AWF VIP
Local time
Today, 12:54
Joined
Jun 21, 2011
Messages
5,899
Sounds like a Windows 10 and yes, restrictions to C:\ which could also be caused by IT department. However, it not opening the files specified, that, I have never seen before.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 17:54
Joined
Feb 19, 2013
Messages
16,605
you obviously did not try stepping through your code

if you had, your would have realised that here

With fd
If .Show Then
.Title = "CHOOSE THE FILES YOU WANT TO IMPORT...."


.Show opens the window - before you have assigned the title etc

try

With fd

.Title = "CHOOSE THE FILES YOU WANT TO IMPORT...."
.AllowMultiSelect = True
.InitialFileName = "C:\" 'CHANGE THIS TO POINT TO THE DIRECTORY WHERE STEPH STORES HER FILES
.Filters.Add "CSV Files", "*.csv"
If .Show Then
 

vba_php

Forum Troll
Local time
Today, 11:54
Joined
Oct 6, 2019
Messages
2,880
is it really that simple? i tried stepping through many areas but not that one. changing that doesn't seem like it would solve the issue, but i'll try it and get back to you....
 

vba_php

Forum Troll
Local time
Today, 11:54
Joined
Oct 6, 2019
Messages
2,880
well good for you, CJ. It works fine. what a simple fix. that's typical of me....figure out the tough stuff, and miss the easy stuff. thanks. now if I could only figure out why those files won't parse properly....
 

Users who are viewing this thread

Top Bottom