Собственно, такая проблемка... Может кто сталкивался? по ключу #page работает идеально!
Код
Sub OpenEplan()
Dim NamedDest, pat1, pat2, pat3 As String
NamedDest = Replace_symbols(Cells(ActiveCell.Row, 18))
pat1 = GetShellFileCommand("PDF")
pat1 = Left(pat1, Len(pat1) - 4)
pat2 = "/n /A""pagemode=bookmarks&nameddest=_AB350_E011_21_0" & """"
'pat2 = "/A ""nameddest=" & NamedDest & """"
pat3 = """" & Cells(1, 1).Value & """"
Shell pat1 & " " & pat2 & " " & pat3, vbNormalFocus
Cells(1, 2) = pat1 & " " & pat2 & " " & pat3
End Sub
Function Replace_symbols(ByVal txt As String) As String
St$ = "=./"
For i% = 1 To Len(St$)
txt = Replace(txt, Mid(St$, i, 1), "_")
Next
Replace_symbols = txt
End Function
Function GetShellFileCommand(FileType As String, Optional Command As String)
Const KEY_ROOT As String = "HKEY_CLASSES_ROOT\"
Dim sKey As String, sProgramClass As String
' All File Extensions should start with a "."
If Left(FileType, 1) <> "." Then FileType = "." & FileType
' Check if the File Extension Key exists and Read the default string value
sKey = KEY_ROOT & FileType & "\"
If RegKeyExists(sKey) Then
sProgramClass = RegKeyRead(sKey)
sKey = KEY_ROOT & sProgramClass & "\shell\"
If RegKeyExists(sKey) Then
' If no command was passed, check the "shell" default string value, for a default command
If Command = vbNullString Then Command = RegKeyRead(sKey)
' If no Default command was found, default to "Open"
If Command = vbNullString Then Command = "Open"
' Check for the command
If RegKeyExists(sKey & Command & "\command\") Then GetShellFileCommand = RegKeyRead(sKey & Command & "\command\")
End If
End If
End Function
Function RegKeyRead(i_RegKey As String) As String
Dim myWS As Object
On Error Resume Next
'access Windows scripting
Set myWS = CreateObject("WScript.Shell")
'read key from registry
RegKeyRead = myWS.RegRead(i_RegKey)
End Function
Function RegKeyExists(i_RegKey As String) As Boolean
Dim myWS As Object
On Error GoTo ErrorHandler
'access Windows scripting
Set myWS = CreateObject("WScript.Shell")
'try to read the registry key
myWS.RegRead i_RegKey
'key was found
RegKeyExists = True
Exit Function
ErrorHandler:
'key was not found
RegKeyExists = False
End Function
Function GetARE(i_RegKey As String) As String
Dim InPath As String
Dim InKey As String
Dim Ind As Integer
Dim PriVer As String
Dim SubVer As String
Dim Exists As Boolean
Exists = False
PriVer = 1
SubVer = 0
For Ind = 1 To 1000
If SubVer > 9 Then
PriVer = PriVer + 1
SubVer = 0
End If
Exists = RegKeyExists(i_RegKey + "\" + PriVer + "." + SubVer + "\InstallPath\")
SubVer = SubVer + 1
If Exists = True Then
SubVer = SubVer - 1
InKey = i_RegKey + "\" + PriVer + "." + SubVer + "\InstallPath\"
InPath = RegKeyRead(InKey)
GetARE = InPath + "\AcroRd32.exe"
Exit For
End If
Next
End Function
Заранее признателен за помощь! PS Забыл добавить, что первоначально пытался открыть с помощью гиперссылки, но там (похоже) полное игнорирование любого текста, размещённого после символа #
Проблемма в следующем: есть горизонтальный динамический диапазон с именем Objects (задан через СМЕЩ и СЧЕТЗ). При создании ComboBox и задания RowSource = "Objects" происходит отображение только первого значения из диапазона. Был найден и подправлен под мои нужды вот такой код: Dim r As Range ComboBox1.Clear For Each r In [II4].CurrentRegion ComboBox1.AddItem r.Value Next r ComboBox1.ListIndex = 0 End If
Но, данный диапазон используется в 60 ComboBox'ах и для каждого переписывать одно и тоже как то не лаконично... Как вариант вижу создание на скрытом листе вертикальной копии диапазона. Есть ещё свежие и красивые идеи?
Добрый день! Собственно все мои потуги описаны в приложении. Необходимо помочь либо исправить формулу массива (ругается на задачу диапазона такой формулой {=СУММЕСЛИ((H4;O4;V4);F22;(G4;N4;U4))} ), либо предложить более лаконичное решение ( я так подозреваю через смещение??)))