質問編集履歴

4

ソース修正

2022/01/13 03:45

投稿

tokumeikibou162
tokumeikibou162

スコア19

test CHANGED
File without changes
test CHANGED
@@ -47,7 +47,7 @@
47
47
  Cells(row, 4) = issue.getElementsByTagName("status").Item(0).getAttribute("name")
48
48
  Cells(row, 5) = issue.getElementsByTagName("priority").Item(0).getAttribute("name")
49
49
  'カスタムフィールド ここでエラーが起きる。
50
- Cells(row,6)=issue.getElementsByTagName("cf_116").Item(0).text
50
+ Cells(row, 6)=issue.getElementsByTagName("cf_116").Item(0).text
51
51
  row = row + 1
52
52
  End If
53
53
 

3

ソース修正

2022/01/13 03:44

投稿

tokumeikibou162
tokumeikibou162

スコア19

test CHANGED
File without changes
test CHANGED
@@ -47,8 +47,7 @@
47
47
  Cells(row, 4) = issue.getElementsByTagName("status").Item(0).getAttribute("name")
48
48
  Cells(row, 5) = issue.getElementsByTagName("priority").Item(0).getAttribute("name")
49
49
  'カスタムフィールド ここでエラーが起きる。
50
- Cells(row, 6) =
51
- issue.getElementsByTagName("cf_116").Item(0).text
50
+ Cells(row,6)=issue.getElementsByTagName("cf_116").Item(0).text
52
51
  row = row + 1
53
52
  End If
54
53
 

2

ソース修正

2022/01/13 03:42

投稿

tokumeikibou162
tokumeikibou162

スコア19

test CHANGED
File without changes
test CHANGED
@@ -5,12 +5,62 @@
5
5
 
6
6
  よろしくお願いします。
7
7
 
8
- ソース(一部)
8
+ ソース
9
+ ```vba
10
+ Dim baseurl As String, targeturl As String
11
+ Dim header As Integer, row As Integer
12
+ Dim min As Integer, max As Integer
13
+ Dim cnt As Integer
14
+ Dim ticketid As String
15
+ Dim dom As Object
16
+ Dim issue As Object
17
+
18
+ baseurl = "http://redmine/"
19
+ header = 5
20
+ row = header + 1
21
+ min = 1
22
+ max = 100
23
+ cnt = min
24
+
25
+ '[A~G]欄の[row~(max-min+1)]行まで一気にクリアする
26
+ Range(Cells(row, 1), Cells(max - min + 1, 7)).Clear
27
+
28
+ Do While Cells(row, 1) = ""
29
+
30
+ ticketid = Trim(str(cnt - header))
31
+
32
+ 'APIアクセスキーなし
33
+ targeturl = baseurl + ticketid + ".xml"
34
+ 'APIアクセスキーあり
35
+ 'targeturl = baseurl + ticketid + ".xml?key=aaaaaaaaaaaaaaaaaaaa"
36
+
37
+ Set dom = CreateObject("MSXML2.DOMDocument")
38
+ dom.async = False
39
+ dom.setProperty "ServerHTTPRequest", True
40
+ dom.Load (targeturl)
41
+ Set issue = dom.ChildNodes.Item(1)
42
+
43
+ If Not (issue Is Nothing) Then
44
+ Cells(row, 1) = issue.getElementsByTagName("id").Item(0).text
45
+ Cells(row, 2) = issue.getElementsByTagName("project").Item(0).getAttribute("name")
46
+ Cells(row, 3) = issue.getElementsByTagName("tracker").Item(0).getAttribute("name")
47
+ Cells(row, 4) = issue.getElementsByTagName("status").Item(0).getAttribute("name")
48
+ Cells(row, 5) = issue.getElementsByTagName("priority").Item(0).getAttribute("name")
49
+ 'カスタムフィールド ここでエラーが起きる。
9
- Cells(row, 7) =
50
+ Cells(row, 6) =
10
51
  issue.getElementsByTagName("cf_116").Item(0).text
52
+ row = row + 1
53
+ End If
54
+
55
+ cnt = cnt + 1
56
+ If cnt > max Then
57
+ GoTo 9999
58
+ End If
59
+ Loop
60
+ 9999
61
+ ```
11
62
 
12
63
  エラー
13
- オブジェクト変数または With ブロック変数が設定されていません
64
+ オブジェクト変数または With ブロック変数が設定されていません
14
-
15
65
  参考サイト
16
66
  https://qiita.com/i-chiaki/items/455a8f639126b11ca090

1

エラー文追加

2022/01/13 03:34

投稿

tokumeikibou162
tokumeikibou162

スコア19

test CHANGED
File without changes
test CHANGED
@@ -9,7 +9,8 @@
9
9
  Cells(row, 7) =
10
10
  issue.getElementsByTagName("cf_116").Item(0).text
11
11
 
12
-
12
+ エラー
13
+ オブジェクト変数または With ブロック変数が設定されていません。
13
14
 
14
15
  参考サイト
15
16
  https://qiita.com/i-chiaki/items/455a8f639126b11ca090