Ronald_yoh
03-09-2009, 10:39 PM
Hi there,
i'm trying to change cell format in excel as "text" from MS Access (VBA).
how do i achive this?
i tried the following code in MS Access but no luck (does not change the format):
Set oExcelApp = New Excel.Application
oExcelApp.Workbooks.Open ("C:\book1.xls")
oExcelApp.Visible = True
oExcelApp.Sheets(1).Activate
oExcelApp.Sheets(1).Cells.Select
With oExcelApp.ActiveCell
.NumberFormat = "@"
End With
oExcelApp.ActiveWorkbook.Save
oExcelApp.Quit
thanks
R
i'm trying to change cell format in excel as "text" from MS Access (VBA).
how do i achive this?
i tried the following code in MS Access but no luck (does not change the format):
Set oExcelApp = New Excel.Application
oExcelApp.Workbooks.Open ("C:\book1.xls")
oExcelApp.Visible = True
oExcelApp.Sheets(1).Activate
oExcelApp.Sheets(1).Cells.Select
With oExcelApp.ActiveCell
.NumberFormat = "@"
End With
oExcelApp.ActiveWorkbook.Save
oExcelApp.Quit
thanks
R