View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Peter Huang [MSFT] Peter Huang [MSFT] is offline
external usenet poster
 
Posts: 225
Default References changing between different platforms - DLL hell returns!

Hi

Here is some code snippet for your reference.
Dim cat As Object
Dim tbl As Object
Dim col As Object
Set cat = CreateObject("ADOX.Catalog")
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "E:\test\excel\test2.xls;Extended Properties=Excel 8.0"
Set tbl = CreateObject("ADOX.Table")
tbl.Name = "TestTable"
Set col = CreateObject("ADOX.Column")
With col
.Name = "Col1"
.Type = adDouble
End With
tbl.Columns.Append col
Set col = Nothing
Set col = CreateObject("ADOX.Column")
With col
.Name = "Col2"
.Type = adVarWChar
End With
tbl.Columns.Append col
cat.Tables.Append tbl

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.