ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   opentext method (https://www.excelbanter.com/excel-programming/351906-opentext-method.html)

[email protected]

opentext method
 
Hello

I had the below code running on Access 97 and Excel 97. When I upgraded
to Access 2000 and Excel 2000 it stopped working. Giving me a message
saying: "OpenText method of Workbooks class failed".

Is there a way to correct this issue? or should I upgrade only to
Access 2000 and keep Excel 97.

Thank you all
Elie Constantine


Private Sub ConvertUsingExcel(FromFile As String, ToFile As String,
Optional Origin As Integer = 2)
Dim objExcel As Object
Dim i As Integer
Dim s As String

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.workbooks.opentext FileName:=FromFile, Origin:=Origin,
StartRow:=1 _
, DataType:=1, TextQualifier:=1, ConsecutiveDelimiter:=False, _
Tab:=False, Semicolon:=False, Comma:=True _
, Space:=False, Other:=False



All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com