Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Get Open File NAme

I am having a problem using getopenfilename function. It runs OK the first
time, but when I go to re-run this routine it does not return an "array" and
the routing does not run a second time.

Can't figgure out the behavior. Has anyone seen this?

++++++++++++++++++++++++++++++++++++++++++++++++
fileToOpen = Application.GetOpenFilename("Excel Files (*.xls), *.xls", , , ,
True)

If IsArray(fileToOpen) Then ' if no files selected, then do nothing,
otherwise, run the routines below

***** AND THEN I MANIPULATE THE DATA HERE *****

fileToOpen.Close
End If
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Get Open File NAme

On 25 jun, 21:26, JimBob wrote:
I am having a problem using getopenfilename function. It runs OK the first
time, but when I go to re-run this routine it does not return an "array" and
the routing does not run a second time.

Can't figgure out the behavior. Has anyone seen this?

++++++++++++++++++++++++++++++++++++++++++++++++
fileToOpen = Application.GetOpenFilename("Excel Files (*.xls), *.xls", , , ,
True)

If IsArray(fileToOpen) Then ' if no files selected, then do nothing,
otherwise, run the routines below

***** AND THEN I MANIPULATE THE DATA HERE *****

fileToOpen.Close
End If


Hi JimBob,

Try this:

Sub ProcessFile()
Dim fileToOpen As String

fileToOpen = Application.GetOpenFilename("Excel files (*.xls),
*.xls")

If fileToOpen < "False" Then
' DO THIS AND THAT
End If

End Sub

HTH,

Wouter

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Get Open File NAme

hi RadarEye

Use False instead if "False" to avoid international problems

See
http://www.oaltd.co.uk/ExcelProgRef/default.htm

Read the International Issues chapter of the book

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"RadarEye" wrote in message ups.com...
On 25 jun, 21:26, JimBob wrote:
I am having a problem using getopenfilename function. It runs OK the first
time, but when I go to re-run this routine it does not return an "array" and
the routing does not run a second time.

Can't figgure out the behavior. Has anyone seen this?

++++++++++++++++++++++++++++++++++++++++++++++++
fileToOpen = Application.GetOpenFilename("Excel Files (*.xls), *.xls", , , ,
True)

If IsArray(fileToOpen) Then ' if no files selected, then do nothing,
otherwise, run the routines below

***** AND THEN I MANIPULATE THE DATA HERE *****

fileToOpen.Close
End If


Hi JimBob,

Try this:

Sub ProcessFile()
Dim fileToOpen As String

fileToOpen = Application.GetOpenFilename("Excel files (*.xls),
*.xls")

If fileToOpen < "False" Then
' DO THIS AND THAT
End If

End Sub

HTH,

Wouter

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Get Open File NAme

Hi

FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls), *.xls")
If FName < False Then
Workbooks.Open (FName)
End If


If you use multiselect then use the array like this

FName = Application.GetOpenFilename(filefilter:="Excel Files, *.xl*", _
MultiSelect:=True)

If IsArray(FileNameXls) = False Then
'do nothing
Else
'Your code
End If



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JimBob" wrote in message ...
I am having a problem using getopenfilename function. It runs OK the first
time, but when I go to re-run this routine it does not return an "array" and
the routing does not run a second time.

Can't figgure out the behavior. Has anyone seen this?

++++++++++++++++++++++++++++++++++++++++++++++++
fileToOpen = Application.GetOpenFilename("Excel Files (*.xls), *.xls", , , ,
True)

If IsArray(fileToOpen) Then ' if no files selected, then do nothing,
otherwise, run the routines below

***** AND THEN I MANIPULATE THE DATA HERE *****

fileToOpen.Close
End If

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
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 2 July 8th 05 05:51 AM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 0 July 2nd 05 08:41 PM


All times are GMT +1. The time now is 12:36 PM.

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

About Us

"It's about Microsoft Excel"