Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) | |||
Write no closed workbook ? | Excel Programming | |||
Write to closed workbook code | Excel Programming | |||
Write to Array from other closed Excel file | Excel Programming |