C
chris seiter
XP, Office 2007
I've got a table I need to export to Excel and the only solution I saw was
TransferSpreadsheet. Below is what I came up with(with help from the
Scripting Guys archives):
Sub Create_Excel_Export()
Dim strReportName As String
Dim strChooseLocation As String
Dim strLocationSave As String
Const acExport = 1
Const acSpreadsheetTypeExcel9 = 9
strReportName = Month(Date) & "-" & Day(Date) & "-" & (Right(Year(Date), 2))
& ".xls"
strChooseLocation = InputBox("Where would you like to save the report?",
"Save Location")
If Right(strChooseLocation, 1) = "\" Then
Else
strChooseLocation = strChooseLocation & "\"
End If
If InStr(1, strChooseLocation, " ", vbTextCompare) Then
strChooseLocation = Chr(34) & strChooseLocation & Chr(34)
Else
End If
strLocationSave = strChooseLocation & strReportName
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"tbTemp_Table_From_qrToBeFilled3_Copy_By_Chris", strLocationSave, True
End Sub
It tells me that there is a "runtime 3270roperty not found" error. I've
tried creating the excel spreadsheet ahead of time, and that doesn't work.
I've double checked spelling and everything is spelled correctly. What could
I be missing?
I've got a table I need to export to Excel and the only solution I saw was
TransferSpreadsheet. Below is what I came up with(with help from the
Scripting Guys archives):
Sub Create_Excel_Export()
Dim strReportName As String
Dim strChooseLocation As String
Dim strLocationSave As String
Const acExport = 1
Const acSpreadsheetTypeExcel9 = 9
strReportName = Month(Date) & "-" & Day(Date) & "-" & (Right(Year(Date), 2))
& ".xls"
strChooseLocation = InputBox("Where would you like to save the report?",
"Save Location")
If Right(strChooseLocation, 1) = "\" Then
Else
strChooseLocation = strChooseLocation & "\"
End If
If InStr(1, strChooseLocation, " ", vbTextCompare) Then
strChooseLocation = Chr(34) & strChooseLocation & Chr(34)
Else
End If
strLocationSave = strChooseLocation & strReportName
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"tbTemp_Table_From_qrToBeFilled3_Copy_By_Chris", strLocationSave, True
End Sub
It tells me that there is a "runtime 3270roperty not found" error. I've
tried creating the excel spreadsheet ahead of time, and that doesn't work.
I've double checked spelling and everything is spelled correctly. What could
I be missing?