+ Reply to Thread
Results 1 to 2 of 2

how to refer to a file in macro without opening the file

  1. #1
    Registered User
    Join Date
    03-27-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    53

    how to refer to a file in macro without opening the file

    i have a macro and .csv file, i run the macro every monday on the same file (file gets downloaded from outlook and file name remains the same, only the data in it changes. and it has only a single sheet of data) i am trying to automate this process using a third party tool.


    how to refer to the sheet in the macro instead of using the Activesheet and ActiveWorkbook, since i don't want to open the datafile each and every time i run the macro.


    Sub test()

    Workbooks.open Filename ="c:\test"

    iRowCount = ActiveSheet.UsedRange.Rows.Count 'How do i refer my data file here instead of using active sheet?






    Any help appreciated

  2. #2
    Registered User
    Join Date
    03-27-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    53

    Re: how to refer to a file in macro without opening the file

    Closed... i found the solution

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Opening file with a macro - Pick file [week] with inputbox
    By VitoBdG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2015, 08:41 AM
  2. VBA stop macro if the file we refer to is not opened
    By lukasz_rz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2014, 05:54 AM
  3. [SOLVED] Can I disallow the user to open a file if he disable the macro while the file is opening?
    By Robin in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-07-2011, 04:17 AM
  4. Replies: 1
    Last Post: 01-26-2007, 02:25 PM
  5. File opening via Macro with varying file name
    By TomFish79 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2005, 09:32 AM

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