Read And Write On A Closed Wbook
i have a closed wbook on a server dir is possible to read and write o this without open it -- sal2 ----------------------------------------------------------------------- sal21's Profile: http://www.excelforum.com/member.php...nfo&userid=204 View this thread: http://www.excelforum.com/showthread.php?threadid=27748 |
Read And Write On A Closed Wbook
This function will do it. Can't remember where I got it from.
Function GetValueFromWB(path, file, sheet, ref) 'Retrieves a value from a closed workbook '---------------------------------------- Dim strSep As String Dim arg As String strSep = "\" 'Make sure the file exists '------------------------- If Right(path, 1) < strSep Then path = path & strSep If bFileExists(path & file) = False Then GetValueFromWB = "File Not Found" Exit Function End If 'Create the argument '------------------- arg = "'" & path & "[" & file & "]" & sheet & "'!" & _ Range(ref).Range("A1").Address(, , xlR1C1) 'Execute an XLM macro '-------------------- GetValueFromWB = ExecuteExcel4Macro(arg) End Function Function bFileExists(strFile As String) As Boolean bFileExists = (Len(Dir(strFile)) 0) End Function RBS "sal21" wrote in message ... i have a closed wbook on a server dir is possible to read and write on this without open it? -- sal21 ------------------------------------------------------------------------ sal21's Profile: http://www.excelforum.com/member.php...fo&userid=2040 View this thread: http://www.excelforum.com/showthread...hreadid=277489 |
Read And Write On A Closed Wbook
No, you have to open the workbook.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "sal21" wrote in message ... i have a closed wbook on a server dir is possible to read and write on this without open it? -- sal21 ------------------------------------------------------------------------ sal21's Profile: http://www.excelforum.com/member.php...fo&userid=2040 View this thread: http://www.excelforum.com/showthread...hreadid=277489 |
All times are GMT +1. The time now is 03:12 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com