advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 71 for ExecuteExcel4Macro 閉じた|開いて|開かず (0.012 sec.)
executeexcel4macro (140), 閉じた (628), 開いて (4901), 開かず (263)
[[20220905112002]]
#score: 14120
@digest: af5d56f5351b5370c462ad012ed8aff8
@id: 92216
@mdate: 2022-09-05T03:47:53Z
@size: 2407
@type: text/plain
#keywords: unsetxlapp (22862), setxlapp (22494), workbookbeforeclose (10268), workbookopen (7675), xlapp (5662), executeexcel4macro (3583), 由: (3508), fullname (2476), lrow (1763), withevents (1089), thisworkbook (1066), debug (1040), 開か (880), module1 (850), tkit (780), workbook (779), う思 (768), print (736), 整理 (669), 判別 (631), 表題 (628), 実験 (602), 2022 (546), explicit (544), 般的 (544), 示頂 (541), 月) (529), の目 (513), 見当 (503), 照先 (462), ファ (436), に解 (421)
『VBAで別ファイルを開かずに実行』(そら)
表題の件ですが ExecuteExcel4Macroを使えば可能かと思うのですが ほんとにExcelで参照先のファイルを開かずに実行できているのでしょうか? 試したのですがいまいちわかりませんでした。 ご教示頂ければ幸いです。 < 使用 Excel:Excel2019、使用 OS:Windows10 > ---- 一般的なブックを開く動作はしていないかと。 そう思われているなら、実験されたかと思いますので、 コードとそう思った状況を提示すれば、回答が付くと思いますよ。 (tkit) 2022/09/05(月) 11:33 ---- tkit様 ご指摘ありがとうございます。 コードは下記 理由:ファイルが開かれた際に、$マークみたいなのでいつも判別してるのですが 下記コードだとその形跡が見当たりませんでした。 Sub TEST() Dim i As Long, j As Long Dim lRow As Long lRow = Cells(Rows.Count, "A").End(xlUp).Row + 1 For i = 1 To lRow For j = 1 To lRow Cells(i, j) = _ ExecuteExcel4Macro("'C:¥Users¥[test.xlsm]Sheet1'!R" & i & "C" & j) Next j Next i End Sub (そら) 2022/09/05(月) 11:40 ---- 例えば... '[ThisWorkbook]----------------------------------------------------------------------- Option Explicit Private WithEvents xlApp As Excel.Application Private Sub xlApp_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Debug.Print Wb.FullName, "xlApp_WorkbookBeforeClose" End Sub Private Sub xlApp_WorkbookOpen(ByVal Wb As Workbook) Debug.Print Wb.FullName, "xlApp_WorkbookOpen" End Sub Sub SetxlApp() Set xlApp = Excel.Application End Sub Sub UnSetxlApp() Set xlApp = Nothing End Sub '[Module1]--------------------------------------------------------------------------- Option Explicit Sub TEST() ThisWorkbook.SetxlApp Debug.Print ExecuteExcel4Macro("'C:¥xxx¥[test.xlsm]Sheet1'!R1C1") ThisWorkbook.UnSetxlApp End Sub Sub TEST2() Dim b As Workbook ThisWorkbook.SetxlApp Set b = Workbooks.Open("C:¥xxx¥test.xlsm") b.Close ThisWorkbook.UnSetxlApp End Sub (白茶) 2022/09/05(月) 12:11 ---- 開く開かないの意味合いが人によって違います。 ファイルにアクセスするだけで開くと取る人もいます。 人の目に解りやすいように整理されてない状態で処理するか 人の目に解りやすい状態で整理して表示してから処理するかの違いでは? (kim) 2022/09/05(月) 12:47 ...
http://www.excel.studio-kazu.jp/wiki/kazuwiki/202209/20220905112002.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97018 documents and 608144 words.

訪問者:カウンタValid HTML 4.01 Transitional