Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default GetOpenFilename xl2000 vs xl2002

Using GetOpenFilename with MultiSelect set to True, when you select files
using the <Shift key they become highlighted and the last in the selection
also has a dashed border. In xl2002, the name of the file with the dashed
border apparently becomes the first element in the array even if it is the
last in the selection. The remainder are listed according to their order in
the folder. This is a departure from xl2000 and is screwing up a project of
mine.

I don't have xl2002 at home and can't double-check it. The above conclusion
was arrived at on Friday using a computer at work that had a program of mine
that was screwing up. The code I used to check it follows. Hoping somehow I
am confused or someone has a simple fix for this. Otherwise I have to create
a clunky patch.

Best regards,
Greg

Sub Test()
Dim FNs As Variant
Dim i As Long
With Application
FNs = .GetOpenFilename("Picture files(*.jpg), *.jpg", _
MultiSelect:=True)
End With
If TypeName(FNs) = "Boolean" Then Exit Sub
For i = LBound(FNs) To UBound(FNs)
MsgBox FNs(i)
Next
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default GetOpenFilename xl2000 vs xl2002

Hi Greg

I am on Excel 2002 SP2.

Using your test (changed jpeg to xls extension) I find the following. If
I use the shift key to select 1 file the last file selected is indeed
the first element of the array. However, the other files are listed in
reverse order to how they appear in the folder i.e if my files in the
folder are listed as follows:
ABC.xls
GEF.xls
XYZ.xls
and I select ABC, hold down shift and then select XYZ the message boxes
appear in this order: XYZ.xls, GEF.xls, ABC.xls.

Alternately if I select XYZ.xls, hold shift and then select ABC.xls the
order in the array is ABC.xls, GEF.xls, XYZ.xls.

Hope this helps
Rowan

Greg Wilson wrote:
Using GetOpenFilename with MultiSelect set to True, when you select files
using the <Shift key they become highlighted and the last in the selection
also has a dashed border. In xl2002, the name of the file with the dashed
border apparently becomes the first element in the array even if it is the
last in the selection. The remainder are listed according to their order in
the folder. This is a departure from xl2000 and is screwing up a project of
mine.

I don't have xl2002 at home and can't double-check it. The above conclusion
was arrived at on Friday using a computer at work that had a program of mine
that was screwing up. The code I used to check it follows. Hoping somehow I
am confused or someone has a simple fix for this. Otherwise I have to create
a clunky patch.

Best regards,
Greg

Sub Test()
Dim FNs As Variant
Dim i As Long
With Application
FNs = .GetOpenFilename("Picture files(*.jpg), *.jpg", _
MultiSelect:=True)
End With
If TypeName(FNs) = "Boolean" Then Exit Sub
For i = LBound(FNs) To UBound(FNs)
MsgBox FNs(i)
Next
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default GetOpenFilename xl2000 vs xl2002

Hi Rowan,

I can't check it tonight but am confident from Friday's tests that when I
ran the code it returned the last of the selection (the file with the dashed
border) first followed by the others according to their index order in the
folder. Example:

ABC.jpg (selected first)
DEF.jpg
GHI.jpg
JKL.jpg (selected last with Shift key held down - dashed border)

Code returned path followed by "JKL.jpg", "ABC.jpg", "DEF.jpg", "GHI.jpg".
Computer in question had xl2002 (unknown build) with Windows XP. Using my
home computer (xl2000 (9.0.2720) with 2000 Professional) it doesn't matter
the order the files are selected. The code always returns (i.e. assigns the
files to the array) according to their index value in the folder. This is
what I want. Odd that you get different results.

I know I can always just select the last in the group first followed by the
first in the group (with the <Shift key held down). This way the first in
the group will have the dashed border and will always become the first in the
array. However, others need to use the program and I can't have this
complication.

Regards,
Greg


"Rowan Drummond" wrote:

Hi Greg

I am on Excel 2002 SP2.

Using your test (changed jpeg to xls extension) I find the following. If
I use the shift key to select 1 file the last file selected is indeed
the first element of the array. However, the other files are listed in
reverse order to how they appear in the folder i.e if my files in the
folder are listed as follows:
ABC.xls
GEF.xls
XYZ.xls
and I select ABC, hold down shift and then select XYZ the message boxes
appear in this order: XYZ.xls, GEF.xls, ABC.xls.

Alternately if I select XYZ.xls, hold shift and then select ABC.xls the
order in the array is ABC.xls, GEF.xls, XYZ.xls.

Hope this helps
Rowan

Greg Wilson wrote:
Using GetOpenFilename with MultiSelect set to True, when you select files
using the <Shift key they become highlighted and the last in the selection
also has a dashed border. In xl2002, the name of the file with the dashed
border apparently becomes the first element in the array even if it is the
last in the selection. The remainder are listed according to their order in
the folder. This is a departure from xl2000 and is screwing up a project of
mine.

I don't have xl2002 at home and can't double-check it. The above conclusion
was arrived at on Friday using a computer at work that had a program of mine
that was screwing up. The code I used to check it follows. Hoping somehow I
am confused or someone has a simple fix for this. Otherwise I have to create
a clunky patch.

Best regards,
Greg

Sub Test()
Dim FNs As Variant
Dim i As Long
With Application
FNs = .GetOpenFilename("Picture files(*.jpg), *.jpg", _
MultiSelect:=True)
End With
If TypeName(FNs) = "Boolean" Then Exit Sub
For i = LBound(FNs) To UBound(FNs)
MsgBox FNs(i)
Next
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default GetOpenFilename xl2000 vs xl2002

Hi Greg

Just tested it again and got the same results as before ie

ABC.xls (selected first)
DEF.xls
GHI.xls
JKL.xls (selected last with Shift key held down - dashed border)

Code returned "JKL.xls", "GHI.xls", "DEF.xls", "ABC.xls".

(Windows 2000 SP4)

I guess if the order is really important then you may have to sort the
array alphabetically.

Regards
Rowan



Greg Wilson wrote:
Hi Rowan,

I can't check it tonight but am confident from Friday's tests that when I
ran the code it returned the last of the selection (the file with the dashed
border) first followed by the others according to their index order in the
folder. Example:

ABC.xls (selected first)
DEF.xls
GHI.xls
JKL.xls (selected last with Shift key held down - dashed border)

Code returned path followed by "JKL.xls", "ABC.xls", "DEF.xls", "GHI.xls".
Computer in question had xl2002 (unknown build) with Windows XP. Using my
home computer (xl2000 (9.0.2720) with 2000 Professional) it doesn't matter
the order the files are selected. The code always returns (i.e. assigns the
files to the array) according to their index value in the folder. This is
what I want. Odd that you get different results.

I know I can always just select the last in the group first followed by the
first in the group (with the <Shift key held down). This way the first in
the group will have the dashed border and will always become the first in the
array. However, others need to use the program and I can't have this
complication.

Regards,
Greg


"Rowan Drummond" wrote:


Hi Greg

I am on Excel 2002 SP2.

Using your test (changed jpeg to xls extension) I find the following. If
I use the shift key to select 1 file the last file selected is indeed
the first element of the array. However, the other files are listed in
reverse order to how they appear in the folder i.e if my files in the
folder are listed as follows:
ABC.xls
GEF.xls
XYZ.xls
and I select ABC, hold down shift and then select XYZ the message boxes
appear in this order: XYZ.xls, GEF.xls, ABC.xls.

Alternately if I select XYZ.xls, hold shift and then select ABC.xls the
order in the array is ABC.xls, GEF.xls, XYZ.xls.

Hope this helps
Rowan

Greg Wilson wrote:

Using GetOpenFilename with MultiSelect set to True, when you select files
using the <Shift key they become highlighted and the last in the selection
also has a dashed border. In xl2002, the name of the file with the dashed
border apparently becomes the first element in the array even if it is the
last in the selection. The remainder are listed according to their order in
the folder. This is a departure from xl2000 and is screwing up a project of
mine.

I don't have xl2002 at home and can't double-check it. The above conclusion
was arrived at on Friday using a computer at work that had a program of mine
that was screwing up. The code I used to check it follows. Hoping somehow I
am confused or someone has a simple fix for this. Otherwise I have to create
a clunky patch.

Best regards,
Greg

Sub Test()
Dim FNs As Variant
Dim i As Long
With Application
FNs = .GetOpenFilename("Picture files(*.xls), *.xls", _
MultiSelect:=True)
End With
If TypeName(FNs) = "Boolean" Then Exit Sub
For i = LBound(FNs) To UBound(FNs)
MsgBox FNs(i)
Next
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default GetOpenFilename xl2000 vs xl2002

I got ahold of a laptop with xl2002 (10.6713.6626) SP3. I tested it and
confirmed what I got at work. Also, file extension and how the files are
arranged in the folder doesn't seem to matter. The order in which they are
returned to the array appears to be purely version dependant. Havn't found
any info on the logic so far.

Thanks for the help. Will continue to look.

Best regards,
Greg

"Rowan Drummond" wrote:

Hi Greg

Just tested it again and got the same results as before ie

ABC.xls (selected first)
DEF.xls
GHI.xls
JKL.xls (selected last with Shift key held down - dashed border)

Code returned "JKL.xls", "GHI.xls", "DEF.xls", "ABC.xls".

(Windows 2000 SP4)

I guess if the order is really important then you may have to sort the
array alphabetically.

Regards
Rowan



Greg Wilson wrote:
Hi Rowan,

I can't check it tonight but am confident from Friday's tests that when I
ran the code it returned the last of the selection (the file with the dashed
border) first followed by the others according to their index order in the
folder. Example:

ABC.xls (selected first)
DEF.xls
GHI.xls
JKL.xls (selected last with Shift key held down - dashed border)

Code returned path followed by "JKL.xls", "ABC.xls", "DEF.xls", "GHI.xls".
Computer in question had xl2002 (unknown build) with Windows XP. Using my
home computer (xl2000 (9.0.2720) with 2000 Professional) it doesn't matter
the order the files are selected. The code always returns (i.e. assigns the
files to the array) according to their index value in the folder. This is
what I want. Odd that you get different results.

I know I can always just select the last in the group first followed by the
first in the group (with the <Shift key held down). This way the first in
the group will have the dashed border and will always become the first in the
array. However, others need to use the program and I can't have this
complication.

Regards,
Greg


"Rowan Drummond" wrote:


Hi Greg

I am on Excel 2002 SP2.

Using your test (changed jpeg to xls extension) I find the following. If
I use the shift key to select 1 file the last file selected is indeed
the first element of the array. However, the other files are listed in
reverse order to how they appear in the folder i.e if my files in the
folder are listed as follows:
ABC.xls
GEF.xls
XYZ.xls
and I select ABC, hold down shift and then select XYZ the message boxes
appear in this order: XYZ.xls, GEF.xls, ABC.xls.

Alternately if I select XYZ.xls, hold shift and then select ABC.xls the
order in the array is ABC.xls, GEF.xls, XYZ.xls.

Hope this helps
Rowan

Greg Wilson wrote:

Using GetOpenFilename with MultiSelect set to True, when you select files
using the <Shift key they become highlighted and the last in the selection
also has a dashed border. In xl2002, the name of the file with the dashed
border apparently becomes the first element in the array even if it is the
last in the selection. The remainder are listed according to their order in
the folder. This is a departure from xl2000 and is screwing up a project of
mine.

I don't have xl2002 at home and can't double-check it. The above conclusion
was arrived at on Friday using a computer at work that had a program of mine
that was screwing up. The code I used to check it follows. Hoping somehow I
am confused or someone has a simple fix for this. Otherwise I have to create
a clunky patch.

Best regards,
Greg

Sub Test()
Dim FNs As Variant
Dim i As Long
With Application
FNs = .GetOpenFilename("Picture files(*.xls), *.xls", _
MultiSelect:=True)
End With
If TypeName(FNs) = "Boolean" Then Exit Sub
For i = LBound(FNs) To UBound(FNs)
MsgBox FNs(i)
Next
End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
XL2002 SUM with a twist... Trevor Williams Excel Worksheet Functions 4 December 9th 09 10:28 AM
HOW TO COPY XL2000 (XP) MACROS TO XL2002 (XP) will A Excel Discussion (Misc queries) 0 January 16th 06 06:48 PM
Using min and max function XL2002 Extremely Aggravated Excel Worksheet Functions 1 September 23rd 05 06:29 PM
Can not open .wb1 file with XL2000 and XL2002 Gaurav Excel Discussion (Misc queries) 1 March 8th 05 12:21 PM
xl2002 doesn't understand macro written under xl2000 sarasta Excel Programming 8 June 26th 04 12:52 PM


All times are GMT +1. The time now is 02:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"