|
Не работает макрос в office 2003
|
|||
---|---|---|---|
#18+
Привет всем Не работает макрос в excel 2003 писал в excel-2000 работает прекрасно а под 2003 не хочет пишет 91 ошибку Windows 2000 Подскажите пож-та где копать ? Option Explicit Private Type BrowseInfo hWndOwner As Long pIDLRoot As Long pszDisplayName As Long lpszTitle As Long ulFlags As Long lpfnCallback As Long lParam As Long iImage As Long End Type Private Enum WhatBrowse BIF_RETURNONLYFSDIRS = &H1 BIF_BROWSEINCLUDEFILES = &H1 Or &H4000 'BIF_BROWSEFORCOMPUTER = &H1000 'BIF_BROWSEFORPRINTER = &H2000 End Enum Private Const MAX_PATH = 260 Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long) Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long Public mes As String Public god As String Public Function fBrowseForFolder(hWndOwner As Long, sPrompt As String, WhatBr) As String Dim iNull As Integer Dim lpIDList As Long Dim lResult As Long Dim sPath As String Dim udtBI As BrowseInfo With udtBI .hWndOwner = hWndOwner .lpszTitle = lstrcat(sPrompt, "") .ulFlags = WhatBr End With lpIDList = SHBrowseForFolder(udtBI) If lpIDList Then sPath = String$(MAX_PATH, 0) '''' lResult = SHGetPathFromIDList(lpIDList, sPath) Call CoTaskMemFree(lpIDList) iNull = InStr(sPath, vbNullChar) If iNull Then sPath = Left$(sPath, iNull - 1) End If fBrowseForFolder = sPath End Function Private Sub CommandButton4_Click() ' *********** Dim sStr As String Dim hWnd As Long 'вместо входящего параметра BIF_BROWSEINCLUDEFILES вы можете использовать одну из 'BIF-констант, описанных строчкой Private Enum WhatBrowse (смотри в разделе General_Declarations) sStr = fBrowseForFolder(hWnd, "Выберите файл !", BIF_BROWSEINCLUDEFILES) Workbooks("osv1.xls").Sheets("Общие_данные").Cells(3, 3).Value = sStr ' *********** End Sub ... Scio me nihil scire <<Jojo®>> ... |
|||
:
Нравится:
Не нравится:
|
|||
11.01.2005, 08:38 |
|
Не работает макрос в office 2003
|
|||
---|---|---|---|
#18+
Dim sStr As String Dim hWnd As Long 'вместо входящего параметра BIF_BROWSEINCLUDEFILES вы можете использовать одну из 'BIF-констант, описанных строчкой Private Enum WhatBrowse (смотри в разделе General_Declarations) sStr = fBrowseForFolder(hWnd, "Выберите файл !", BIF_BROWSEINCLUDEFILES) Workbooks("osv1.xls").Sheets("Общие_данные").Cells(3, 3).Value = sStr End Sub Scio me nihil scire <<Jojo®>> ... |
|||
:
Нравится:
Не нравится:
|
|||
11.01.2005, 08:40 |
|
|
start [/forum/topic.php?fid=61&msg=32858304&tid=2186304]: |
0ms |
get settings: |
10ms |
get forum list: |
13ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
55ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
49ms |
get tp. blocked users: |
2ms |
others: | 14ms |
total: | 166ms |
0 / 0 |