I'm using this code to export the Detail section of a form:
DoCmd.OutputTo acOutputForm, "Form1", acFormatXLS, "C:\Form1.xls", False
Dim objXL As Object
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
Set objXL = GetObject("C:\Form1.xls")
objXL.Application.Visible = True
objXL.Parent.Windows(1).Visible = True
This works but all the data appears as text. I should add that all the numeric data is held in textboxes on the form (although their format is numeric) - could that be why and if so, how can I correct it ?
Secondly, if Excel is already open, the code above doesn't seem to open the spreadsheet? ANy ideas why?
Thanks
DoCmd.OutputTo acOutputForm, "Form1", acFormatXLS, "C:\Form1.xls", False
Dim objXL As Object
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
Set objXL = GetObject("C:\Form1.xls")
objXL.Application.Visible = True
objXL.Parent.Windows(1).Visible = True
This works but all the data appears as text. I should add that all the numeric data is held in textboxes on the form (although their format is numeric) - could that be why and if so, how can I correct it ?
Secondly, if Excel is already open, the code above doesn't seem to open the spreadsheet? ANy ideas why?
Thanks