Excel レポートがあります。Access には、TRUE/FALSE 回答しかない値があります。これらの値を各レポートで (たとえば) Open/Closed に変更するにはどうすればよいですか。
このレポートでは、必要なすべての値を取得するクエリ (excel_open_projects) を取得しました。
Path = CurrentProject.Path & "\"
filename = "Open_Projects_" & Format(Now(), "YYYYMMDDHHNNSS") & ".xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2003, "excel_open_projects", Path & filename
最初の行の値を変更するコードを既に取得しています。
Public Sub openXL()
'Variables to refer to Excel Objects
Dim MySheetPath As String
Dim Xl As Excel.Application
Dim XlBook As Excel.Workbook
Dim XlSheet As Excel.Worksheet
Dim row_count, i As Integer
' Tell it location of actual Excel file
MySheetPath = Path & filename
MsgBox MySheetPath
'Open Excel and the workbook
Set Xl = CreateObject("Excel.Application")
Set XlBook = GetObject(MySheetPath)
'Make sure excel is visible on the screen
Xl.Visible = True
XlBook.Windows(1).Visible = True
'Define the sheet in the Workbook as XlSheet
Set XlSheet = XlBook.Worksheets(1)
'Insert Row and the Value in the excel sheet starting at specified cell
XlSheet.Range("A1") = "Column A"
'Clean up and close worksheet
XlBook.Save
XlBook.Close
Set Xl = Nothing
Set XlBook = Nothing
Set XlSheet = Nothing
End Sub
事前にご協力いただきありがとうございます。