LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Workbooks.Opentext - oldskool '97

Hi all,

I can't seem to figure this out no matter what I try so I'd really
appreciate if anyone could answer a couple of quick questions on this
bit of code (I know it's old skool now but it needs to be in Office 97)
-

I've got an Access 97 database trying to mess around with a couple of
excel files -
Dim xlApp as object, mysheet as object, mysheet2 as object
set xlApp = CreateObject("Excel.Application")
set mysheet = xlApp.Workbooks.Open("myfile.xls").Sheets(1)
set mysheet2 = xlApp.Workbooks.OpenText("myfile.txt", , 1, xlDelimited,
xlTextQualifierNone, False, False, False, False, False, True, "|",
Array(1,2)).Sheets(1)

but when it gets to mysheets2 I get run time error 424 - Object
Required. Although strangely when I make Excel visible I can see that
it's opened the file. Hence my questions are -
- Can the vba version of Excel open to workbooks at the same time (I
would assume so)?
- Or is the mysheet2 object trying to reference sheet 1 before the file
has been converted?
- Other than that, what am I doing wrong

I want to move forward with -
mysheet2.cells(2,8).Formula = "=A1*A2"
but as mysheet2 doesn't reference anything I can't get past it.

Any help would be much appreciated, thanks,

Brad

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbooks.OpenText problem in XL2000 Mike Iacovou Excel Programming 4 May 18th 06 06:07 PM
Workbooks.OpenText StartRow:=2 Not Skipping Row 1 John Saunders Excel Programming 2 August 26th 05 11:51 AM
Workbooks.OpenText does not work on XP. HELP !!! [email protected] Excel Programming 6 May 31st 05 03:18 PM
How to open UTF-8 files with Workbooks.OpenText Mete Kural Excel Programming 0 May 7th 05 01:25 AM
Workbooks.OpenText Alistair Eberst Excel Programming 2 October 21st 03 12:50 PM


All times are GMT +1. The time now is 09:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"