|
|
|
|
Título da Dica: Exportando uma base de dados Access para Excel
|
|
|
|
Postada em 7/7/2003 por Ronaldão
Dim myEx As Object Set myEx = CreateObject("Excel.Application") Set myWorbook = myEx.workbooks.Add() Set myWorkseet = myWorbook.worksheets(1) myWorkseet.Range("A1").Select With myWorkseet.QueryTables.Add(Connection:=Array(Array( _ "ODBC;DSN=MS Access Database;DBQ=<databasefilenamename>;DriverId=25;FIL=MS Access;MaxBufferSize=" _ ), Array("2048;PageTimeout=5;")), Destination:=myWorkseet.Range("A1")) .CommandText = Array( _ " Select * FROM `<databasefilenamename tablename>" _ ) .Name = "LCMS09292001" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = False .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = True .SaveData = False .AdjustColumnWidth = True .RefreshPeriod = 0 .PreserveColumnInfo = True .Refresh BackgroundQuery:=False End With myEx.Visible = True Set myWorkseet = Nothing Set myWorbook = Nothing Set myEx = Nothing End Sub
|
|
|
|
|