Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel / VB???:)) Question 2

Status
Not open for further replies.

q4s72534

MIS
Aug 19, 2003
59
US
below is the code i'm using to pull data from an open workbook in excel. is there a way to pull data from a closed workbook? THANKS SOOOO much.


Sub OpenWorkbook()
Dim wb As String
wb = "Workbook_You_Want_To_Open_With_Path_&_File_Extention"
Application.Workbooks.Open (wb)
End Sub

 
You could try this:

Code:
msgbox ExecuteExcel4macro("'Workbook_You_Want_To_Open_Path[File_Name_&_Extention]Sheet_Name'!R1C1")[code][/color][/b]

This will show you a Message Box that returns the value in cell A1 of the Workbook and the Sheet you specify!

Or you could try the ADO or DAO paths, or run a External Data Query.

I hope this helps!



Peace! [peace]

Mike

[COLOR=red][b]Never say Never!!!
Nothing is impossible!!![/b][/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top