Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default How to use .GetOpenFilename in For loop?

Milind,

Are you trying to lop through the sheets in the workbook you have just
opened? If so, you don't need a filename, you can use ActiveWorkbook, like
this

Dim fileToOpen

fileToOpen = Application _
.GetOpenFilename("Microsoft Excel Files (*.xls), *.xls")
If fileToOpen < False Then
For Each c In ActiveWorkbook
'DO SOMETHING
Next
End If


--

HTH

Bob Phillips

"Milind" wrote in message
...
I need the user to select his file, and am using the
.GetOpenFilename format. However, I need to use the following:

For each c in workbooks("filename"). ...

What to do about the reqd quotation marks around the filename, and what to
do about the "\" path marks which excel does not recognise?

Milind


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.506 / Virus Database: 303 - Release Date: 8/1/2003




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
Using filename retrieved from GetOpenFilename Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 2 September 12th 08 07:47 PM
Using GetOpenFilename Robin Seaby Excel Programming 2 August 6th 03 04:50 PM
GetOpenFilename - Problem Tom Excel Programming 2 August 4th 03 07:52 PM
GetOpenFilename and arrays Shunt Excel Programming 1 July 31st 03 04:26 PM
GetOpenFilename Daniel[_4_] Excel Programming 3 July 27th 03 11:00 AM


All times are GMT +1. The time now is 08: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"