exporting to Excel (format of cells)

qwertyjjj

Registered User.
Local time
Today, 12:29
Joined
Aug 8, 2006
Messages
262
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
 

Users who are viewing this thread

Back
Top Bottom