Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default reading contents of a file

Hello,

How do I open a file browse window and have my spread
sheet read the contents and write them to a worksheet?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default reading contents of a file

Christopher,

Try something like the following:


Dim FName As Variant
Dim WB As Workbook
FName = Application.GetOpenFilename("Excel files ,*.xls")
If FName = False Then
' no file chosen
Exit Sub
End If
Set WB = Workbooks.Open(Filename:=FName)
'
' do something with WB
'

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Christopher Brooks" wrote in
message ...
Hello,

How do I open a file browse window and have my spread
sheet read the contents and write them to a worksheet?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default reading contents of a file

Dim fname as String
fname = Application.GetOpenFileName
if fname < "False" then
workbooks.open fname
End if

If you are talking about something other than an XLS file, then you would
have to be more specific.

--
Regards,
Tom Ogilvy


"Christopher Brooks" wrote in message
...
Hello,

How do I open a file browse window and have my spread
sheet read the contents and write them to a worksheet?

Thanks



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
Reading contents Fiona Excel Discussion (Misc queries) 3 June 28th 07 02:56 AM
reading from another file and pasting to current file, "combobox" Darius New Users to Excel 1 September 26th 05 07:13 AM
reading cell contents in a macro needin' help Excel Programming 1 January 20th 04 04:34 AM
Browsing to URL and reading contents Mike[_49_] Excel Programming 9 November 20th 03 07:53 PM
Reading from file Asif[_3_] Excel Programming 4 November 16th 03 05:28 AM


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

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"