Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Get values from a closed workbook


I got this code from the website:

Sub test()
GetValuesFromAClosedWorkbook "C:", "Book1.xls", "Sheet1", "A1:A30"
End Sub

Sub GetValuesFromAClosedWorkbook(fPath As String, fName As String, _
sName, cellRange As String)

With ActiveSheet.Range(cellRange)
..FormulaArray = "='" & fPath & "\[" & fName & "]" & sName &
"'!" & _ cellRange
..Value = .Value
End With
End Sub

Can someone explain how it works? It looks like the path/file name is
already configured, so why (when I run the code) does an "Update
Records" dialog box pop up?


--
kev_06
------------------------------------------------------------------------
kev_06's Profile: http://www.excelforum.com/member.php...o&userid=35046
View this thread: http://www.excelforum.com/showthread...hreadid=559565

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Get values from a closed workbook

Dear KEV06,

Let me try to explain you that :
(the explanation is after " '--" and " _" mark & ended by dot.)

Sub test()
GetValuesFromAClosedWorkbook "C:", "Book1.xls", "Sheet1", "A1:A30"
' -- call _
GetValuesFromAClosedWorkbook sub event to raised up the event.
End Sub

Sub GetValuesFromAClosedWorkbook(fPath As String, fName As String, _
sName, cellRange As String)

With ActiveSheet.Range(cellRange)
.FormulaArray = "='" & fPath & "\[" & fName & "]" & sName &
"'!" & cellRange ' -- excel _
standard way of linked cells to another Workbook that
currently not open.
.Value = .Value ' -- return formularray to value.
End With
End Sub


Or you can contact me directly to
thats all,

halim



kev_06 menuliskan:
I got this code from the website:

Sub test()
GetValuesFromAClosedWorkbook "C:", "Book1.xls", "Sheet1", "A1:A30"
End Sub

Sub GetValuesFromAClosedWorkbook(fPath As String, fName As String, _
sName, cellRange As String)

With ActiveSheet.Range(cellRange)
.FormulaArray = "='" & fPath & "\[" & fName & "]" & sName &
"'!" & _ cellRange
.Value = .Value
End With
End Sub

Can someone explain how it works? It looks like the path/file name is
already configured, so why (when I run the code) does an "Update
Records" dialog box pop up?


--
kev_06
------------------------------------------------------------------------
kev_06's Profile:
http://www.excelforum.com/member.php...o&userid=35046
View this thread: http://www.excelforum.com/showthread...hreadid=559565


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Get values from a closed workbook

See
http://www.rondebruin.nl/copy7.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl



"kev_06" wrote in message
...

I got this code from the website:

Sub test()
GetValuesFromAClosedWorkbook "C:", "Book1.xls", "Sheet1", "A1:A30"
End Sub

Sub GetValuesFromAClosedWorkbook(fPath As String, fName As String, _
sName, cellRange As String)

With ActiveSheet.Range(cellRange)
FormulaArray = "='" & fPath & "\[" & fName & "]" & sName &
"'!" & _ cellRange
Value = .Value
End With
End Sub

Can someone explain how it works? It looks like the path/file name is
already configured, so why (when I run the code) does an "Update
Records" dialog box pop up?


--
kev_06
------------------------------------------------------------------------
kev_06's Profile: http://www.excelforum.com/member.php...o&userid=35046
View this thread: http://www.excelforum.com/showthread...hreadid=559565



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 values from a closed workbook Graham F New Users to Excel 6 July 28th 08 03:32 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Getting Values From A Closed Workbook roshinpp_77[_2_] Excel Programming 3 May 30th 06 01:36 PM
Cell Values from a Closed Workbook JK Excel Programming 4 February 22nd 06 05:31 PM
Code that retrieves values from a closed workbook Todd Huttenstine Excel Programming 1 April 28th 04 07:34 PM


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