+ Reply to Thread
Results 1 to 2 of 2

Find Active worksheet after Workbooks.Opentext???

  1. #1
    Registered User
    Join Date
    09-21-2007
    Posts
    3

    Find Active worksheet after Workbooks.Opentext???

    Excel 2002 SP3

    I'm trying to write a set of macros to read ; text files and do some charting.

    So I have Workbooks.OpenText working to open the data properly, but then I need to get a reference to the current sheet of which there is only one. But no reference that I try will work. They all toss an error '91 Object or With block not set.

    After I do the OpenText and make the new workbook, then I need to call a series of subs to do format the data and do some charting. The formatting - recorded from a macro, works just fine, so I know the OpenText call leaves the new data as the active sheet, but I need an object reference to the active sheet to continue with the processing, and I can't get that reference.

    The code for the first failing routine looks like this:
    Please Login or Register  to view this content.
    I figure I'm doing something simple and stupid, but in spite of 5 inches of books to look through I can't find a working example of what I need.

    Thanks much,
    ww
    Last edited by VBA Noob; 09-26-2007 at 06:43 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    As you are on the text sheet, then to find the last row you can do something like

    Please Login or Register  to view this content.
    If you still need a reference to that sheet then

    Please Login or Register  to view this content.
    HTH

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1