LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Getting information from a file

Are you gonna open the file to get the value?

dim wkbk as workbook
dim myFileName as variant
dim MyValue as variant

myfilename = application.getopenfilename("Excel files, *.xls")
if myfilename = false then
exit sub
end if

set wkbk = workbooks.open(filename:=myfilename)
myvalue = wkbk.worksheets("sheet1").range("a7").value
wkbk.close savechanges:=false

========
But John Walkenbach has a routine that can get values from a closed workbook:
http://j-walk.com/ss/excel/eee/eee009.txt
Look for either: GetDataFromClosedFile or GetValue.

Steve wrote:

Hi

I think I should have asked this with my earlier question.

I now have the file name using getopenfilename.

However, I now want to start getting various bit of information from various
sheets in that file.

I have tried the following just to get myself started but with no success.

Name = myFileName.worrksheets("sheet1").Range("A7").Value

where my filename is the variable used for the return fileanme.

Please help

Many thanks

--
Steve R


--

Dave Peterson
 
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
Import file information nickodemos Excel Discussion (Misc queries) 0 April 22nd 09 09:45 PM
Displaying row information in another file Jeff Weinberg Excel Worksheet Functions 1 March 19th 07 04:33 PM
Using information in one excel file in another Andrew Pickles Excel Worksheet Functions 0 January 15th 07 01:01 PM
File Information?? ianripping[_48_] Excel Programming 3 April 20th 04 10:35 AM
file information Stuart[_12_] Excel Programming 3 November 29th 03 12:37 AM


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