--!arr = !!ReadXlsx('d:\1.xlsx')
define function !!ReadXlsx(!path is string) is array  
var !pdmsinstalleddir evar 'pdms_installed_dir'
--  var !DllPath EVAR DLLPATH
  --!LoadDll = |IMPORT '| + !DllPath + '\SQLOBJ' + |'|
  
!suffix= !!getdllsuffix()

--копируем dll файл в pdmsuser
var !pdmsuser evar 'pdmsuser'
!curdir = !!PML.GetPathName('readxlsx.pmlfnc').replace('/readxlsx.pmlfnc','').replace('/','\')
--$p $!curdir
!f = object file(!pdmsuser + '\Epplusobj_' + !suffix + '.dll')
if not !f.exists() then
  !cmd = 'copy ' + !curdir + '\dll\Epplusobj_' + !suffix + '.dll ' + !pdmsuser + '\Epplusobj_' + !suffix + '.dll'
  --$p $!cmd
  syscom '$!cmd'
endif



!f = object file(!pdmsuser + '\Epplus.dll')
if not !f.exists() then
  !cmd = 'copy ' + !curdir + '\dll\Epplus.dll ' + !pdmsuser + '\Epplus.dll'
  --$p $!cmd
  syscom '$!cmd'
endif
!SESSION = CURRENT SESSION
!module = !session.module()
!LoadDll = |IMPORT '| + !pdmsuser + '\EPPlusOBJ_$!suffix' + |'|

--$p $!LoadDll 	
  $!LoadDll 	
  handle (1000,0)
  endhandle
  using namespace 'EPPlusOBJ'
  
  !OBJ = object EPPlusObject()
  !retval = array ()
  
    !retval = !OBJ.ReadXlsx(!path)
	handle any
	  $p ОШИБКА чтения !!ReadXlsx('$!path')
	  return error
	endhandle

    return !retval
endfunction
