오빠두엑셀 `2026 무료 챌린지` 오픈! 완주하고 수료증 받아가세요! 5년 연속 IT분야 베스트셀러! 「 진짜쓰는 실무엑셀 」로 2026년 공부 끝내기 엑셀이 막히셨나요? Q&A 게시판에서 바로 해결하세요.
메뉴
미해결 엑셀2021윈도우10

빠른실행도구모음 리스트 구하기

나야
12월 9일 조회 577
빠른실행도구모음리스트를 구하는데 매크로 이름이랑 매크로 파일 위치를(모듈까지) 구하고 싶습니다.

검색해도 잘안나고오 구글제미니 챗gpt 뤼튼 코파일럿등으로 해도 아래같은 코드만 알려주고 정상적으로 작동이 안됩니다.

SSub ListQuickAccessMacros()
Dim cb As CommandBar
Dim ctl As CommandBarControl

On Error Resume Next
Set cb = Application.CommandBars("Quick Access Toolbar")
On Error GoTo 0

If cb Is Nothing Then
MsgBox "빠른 실행 도구 모음을 찾을 수 없습니다.", vbExclamation
Exit Sub
End If

For Each ctl In cb.Controls
If ctl.OnAction <> "" Then
Debug.Print "매크로 이름: " & ctl.OnAction
Debug.Print "매크로 위치: " & ctl.Parameter
End If
Next ctl
End Sub

댓글 1

나야 작성자 12월 11일
이렇게 하면 대충 나옵니다.

Excel Customizations.exportedUI 사용자정의모음 텍스트 파일로 열어서

a1셀에 넣는다

Sub SplitXMLText()
Dim ws As Worksheet
Dim cell As Range
Dim text As String
Dim lines() As String
Dim i As Integer

Range("C1:C200").ClearContents
' 현재 워크시트 설정
Set ws = ActiveSheet
' MsgBox ws

' 분리할 텍스트가 있는 셀 설정
Set cell = ws.Range("A1")

' 셀의 텍스트 가져오기
text = cell.Value

' 텍스트를 "><"로 분리
lines = Split(text, "><")

' 분리된 텍스트를 셀에 출력
For i = LBound(lines) To UBound(lines)
ws.Cells(i + 1, 3).Value = "<" & lines(i) & ">"
Next i
End Sub

텍스트 나눈다

=ExtractLabel(C2)

=ExtractOnAction(C2)

Function ExtractLabel(xmlText As String) As String
Dim labelStart As Long, labelEnd As Long
Dim idQStart As Long, idQEnd As Long
Dim extractedLabel As String

On Error Resume Next

' Try to extract the label if it exists
labelStart = InStr(xmlText, "label=""") + Len("label=""")
If labelStart > Len("label=""") Then
labelEnd = InStr(labelStart, xmlText, """")
extractedLabel = Mid(xmlText, labelStart, labelEnd - labelStart)
Else
' If label doesn't exist, try to extract idQ as a fallback
idQStart = InStr(xmlText, "idQ=""") + Len("idQ=""")
If idQStart > Len("idQ=""") Then
idQEnd = InStr(idQStart, xmlText, """")
extractedLabel = Mid(xmlText, idQStart, idQEnd - idQStart)
Else
extractedLabel = "" '"No label or idQ found"
End If
End If

' Optional: Clean up any unwanted parts, removing specific terms
extractedLabel = Application.WorksheetFunction.Substitute(extractedLabel, "ontrol idQ=", "")
extractedLabel = Application.WorksheetFunction.Substitute(extractedLabel, "ontrol id=", "")
extractedLabel = Application.WorksheetFunction.Substitute(extractedLabel, "ab idQ=", "")
extractedLabel = Application.WorksheetFunction.Substitute(extractedLabel, "roup idQ=", "")
extractedLabel = Application.WorksheetFunction.Substitute(extractedLabel, "ustomUI xmlns:x1=", "")
extractedLabel = Application.WorksheetFunction.Substitute(extractedLabel, "mso:", "")

On Error GoTo 0

ExtractLabel = extractedLabel
End Function

 

Function ExtractOnAction(xmlText As String) As String
Dim onActionStart As Long, onActionEnd As Long

On Error Resume Next
onActionStart = InStr(xmlText, "onAction=""") + Len("onAction=""")
onActionEnd = InStr(onActionStart, xmlText, """")
ExtractOnAction = Mid(xmlText, onActionStart, onActionEnd - onActionStart)
ExtractOnAction = Application.WorksheetFunction.Substitute(ExtractOnAction, "rol idQ=", "")
ExtractOnAction = Application.WorksheetFunction.Substitute(ExtractOnAction, "rol id=", "")
ExtractOnAction = Application.WorksheetFunction.Substitute(ExtractOnAction, "rol id=", "")
ExtractOnAction = Application.WorksheetFunction.Substitute(ExtractOnAction, "omUI xmlns:x1=", "")
ExtractOnAction = Application.WorksheetFunction.Substitute(ExtractOnAction, "p idQ=", "")
ExtractOnAction = Application.WorksheetFunction.Substitute(ExtractOnAction, "idQ=", "")

ExtractOnAction = Application.WorksheetFunction.Substitute(ExtractOnAction, "p idQ=", "")
ExtractOnAction = Application.WorksheetFunction.Substitute(ExtractOnAction, "p id=", "")
ExtractOnAction = Application.WorksheetFunction.Substitute(ExtractOnAction, "id=", "")
On Error GoTo 0
End Function

 

질문답변 게시판의 최근 글

스크랩 완료