RonP
October 4th, 2002, 10:43 AM
Hi all
I am using VBA to export from Mararch 6.0 when I try to import the Excel file to Access XP I get a message stating that the file is not the right format. It seem that the file is being exported as Excel 2.0 format. I have Monarch set to export as Excel 8.0. Can you help me below is the code I am using:
Private Sub cmdBatch_Click()
Dim MonarchObj As Object
Dim OpenFile, openmod, t As Boolean
Set MonarchObj = GetObject("", "Monarch32")
If MonarchObj Is Nothing Then
Set MonarchObj = CreateObject("Monarch32")
End If
t = MonarchObj.SetLogFile("C:MonTempMPrg_G5.log", False)
OpenFile = MonarchObj.SetReportFile("y:kls_kmw3270phuphutoday", False)
If OpenFile = True Then
openmod = MonarchObj.SetModelFile("y:kls_kmwMonarchModPick Detail Holdup Model W.mod")
If openmod = True Then
MonarchObj.CurrentFilter = "Div"
MonarchObj.ExportTable ("Y:kls_kmwexcelholdupsDailyHU.xls")
End If
End If
MonarchObj.CloseAllDocuments
MonarchObj.Exit
End Sub
Thanks
Ron
I am using VBA to export from Mararch 6.0 when I try to import the Excel file to Access XP I get a message stating that the file is not the right format. It seem that the file is being exported as Excel 2.0 format. I have Monarch set to export as Excel 8.0. Can you help me below is the code I am using:
Private Sub cmdBatch_Click()
Dim MonarchObj As Object
Dim OpenFile, openmod, t As Boolean
Set MonarchObj = GetObject("", "Monarch32")
If MonarchObj Is Nothing Then
Set MonarchObj = CreateObject("Monarch32")
End If
t = MonarchObj.SetLogFile("C:MonTempMPrg_G5.log", False)
OpenFile = MonarchObj.SetReportFile("y:kls_kmw3270phuphutoday", False)
If OpenFile = True Then
openmod = MonarchObj.SetModelFile("y:kls_kmwMonarchModPick Detail Holdup Model W.mod")
If openmod = True Then
MonarchObj.CurrentFilter = "Div"
MonarchObj.ExportTable ("Y:kls_kmwexcelholdupsDailyHU.xls")
End If
End If
MonarchObj.CloseAllDocuments
MonarchObj.Exit
End Sub
Thanks
Ron