Read values from closed workbook? - Excel Help & Excel Macro Help
SEARCH ENTIRE SITE LOADING..

OZGRID Excel Help & Excel Best Practices Forums

Information Helpful? Why Not Donate.

SPECIALS PAGE FOR BARGAINS | BUILD YOUR GOLF SWING | FREE CUSTOM FUNCTIONS ADD-IN


Download Active Data For Excel Demo


Go Back Excel Help & Excel Macro Help > HELP FORUMS > EXCEL HELP
HOME Register Forum Help Calendar Search For Today's Posts Mark Forums Read

Reply

Read values from closed workbook?

ANSWERS TO SIMILAR QUESTIONS
Copy Row Values To Closed WorkbookGet Values From Closed WorkbookRead Text From A Closed WorkbookValues From A Closed Workbook



Javascript DHTML Drop Down Menu Powered by dhtml-menu-builder.com

Create Excel dashboards quickly with Plug-N-Play reports.


 
Thread Tools Search this Thread
Old November 4th, 2004
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
gfcaim gfcaim is offline
Member
 
I'm a Spammer:
MS Office Version: 2002(XP)
Op System: Windows 2000
Assumed Experience: Well above average
Join Date: 1st October 2004
English is 1st Language:
Posts: 39 -- Threads: 14
Read values from closed workbook?

Is it possible for a macro in Workbook_A.xls that is open to read values in Workbook_B.xls that is closed? Both workbooks are stored in the same directory.

I know it can be doen by linking but this is not what i need.

If so could someone please show me an example.
Print [Post / Thread] Reply With Quote
Old November 4th, 2004
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
tinyjack tinyjack is offline
Established Member
 
I'm a Spammer:
MS Office Version: 2003
Op System: Windows XP
Assumed Experience:
Join Date: 6th September 2004
English is 1st Language:
Posts: 438 -- Threads: 0
VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes".
Function GetMax(strMatrix As String) As Long Dim strResult As String Dim strPullText As String 'If we get an error in this function it is because the sheet does not exist On Error Goto NoPage 'Build the string to pull the value from the closed file strPullText = "'" & filePATH & "[" & fileMATRIX & "]" & Trim(strMatrix) & "'!R3C2" 'Pull the value from the closed file GetMax = Application.ExecuteExcel4Macro(strPullText) Exit Function NoPage: 'There was an error so return the fact that the matrix is missing GetMax = 0 Err.Clear End Function

You will need to tailor this to suit and adjust the error handling.

filePATH and fileMATRIX are constants that I have setup in my project.

TJ
__________________
Oh dear I need a beer
Online Motorsport Game
Print [Post / Thread] Reply With Quote
Old November 4th, 2004
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
gfcaim gfcaim is offline
Member
 
I'm a Spammer:
MS Office Version: 2002(XP)
Op System: Windows 2000
Assumed Experience: Well above average
Join Date: 1st October 2004
English is 1st Language:
Posts: 39 -- Threads: 14
Thanks - works, but asks to open the workbook on each value. I am looking at loading a array of dimensions 5000x2!

Any other ideas?
Print [Post / Thread] Reply With Quote
Old November 4th, 2004
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
tinyjack tinyjack is offline
Established Member
 
I'm a Spammer:
MS Office Version: 2003
Op System: Windows XP
Assumed Experience:
Join Date: 6th September 2004
English is 1st Language:
Posts: 438 -- Threads: 0
You could have a look here:

http://j-walk.com/ss/excel/tips/tip82.htm

But I would open the workbook, get the array and then close the workbook.

TJ
__________________
Oh dear I need a beer
Online Motorsport Game
Print [Post / Thread] Reply With Quote
Reply Lifetime Upgrade To Ad Free Styles

   « PREVIOUS looking up date ranges using VBA || Cell Search NEXT »
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 01:41.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Ozgrid is Not Associated With Microsoft. Ozgrid Retains the Rights to ALL Posts and Threads