1
Abra Microsoft Office Access 2007 , seleccione " Herramientas de base de datos " y luego haga clic en " Visual Basic ". Seleccione el menú "Insertar" y haga clic en " módulos".
2
Copia y pega lo siguiente en el nuevo módulo.
Private Sub ExportAccessDataToExcel ()
Dim SqlString As String
SqlString = " CREATE TABLE testMeasurements ( TestName TEXTO , TEXTO Estado)"
DoCmd.SetWarnings False
DoCmd.RunSQL ( SqlString )
< p > SqlString = "INSERT INTO testMeasurements VALUES ( 'Power media ', ' PASS ')"
DoCmd.RunSQL ( SqlString )
SqlString = "INSERT INTO testMeasurements VALUES ( 'Power Vs Time' , " FALLA " ) "
DoCmd.RunSQL ( SqlString )
SqlString =" testMeasurements.TestName SELECT, testMeasurements.Status EN ExportToExcel "
SqlString = SqlString &" DE testMeasurements "
SqlString = SqlString &" WHERE ( ( ( testMeasurements.TestName ) = 'Power media ')) ; "
DoCmd.RunSQL ( SqlString )
DoCmd.TransferSpreadsheet acExport , acSpreadsheetTypeExcel7 , _
" ExportToExcel ", "G : \\ TestMeasurements.xls " Es cierto ", A1: G12 "
End Sub
3
Ejecute la subrutina con la tecla " F5 ".