これが私が使用しているコードです。
正常に動作しますが、列見出しを除外するために必要な追加コードを知る必要があります。
Private Sub Command104ContrDonatWeekly_Click()
On Error GoTo Command104ContrDonatWeekly_Click_Err
DoCmd.OpenQuery "Contributors Who Donated in Past Week", acViewNormal, acEdit
xlfile = "C:\Users\Michael1\Desktop\KSN\DistributionListWeekly.xlsb"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, _
"Contributors Who Donated in Past Week", xlfile, True, "EmailList"
Shell "Excel.exe " & xlfile, vbNormalFocus
Command104ContrDonatWeekly_Click_Exit:
Exit Sub
Command104ContrDonatWeekly_Click_Err:
MsgBox Error$
Resume Command104ContrDonatWeekly_Click_Exit
End Sub
ここにいくつかのコードがあります
Excelですべての列と行の見出しを非表示にするVBAコードを作成する方法は?
which I don't quite know where it needs to be placed in with the code I am already using.
Private Sub hideHeadings()
Dim wrkbk As Workbook
Dim wrksh As Worksheet
Dim prev As Window
Set prev = ActiveWindow
For Each wrkbk In Workbooks
For Each wrksh In wrkbk.Worksheets
wrksh.Activate
ActiveWindow.DisplayHeadings = False
Next wrksh
Next wrkbk
prev.Activate
End Sub