open file (as variable) from macro

From: d chaps (chaps_at_discussions.microsoft.com)
Date: 03/14/05


Date: Mon, 14 Mar 2005 14:37:07 -0800

User inputs a date etc., I add path in front of date and some other
manipulation, and come up w/ the filename that I'm trying to open with a
macro. Then I work on that file, print it, etc. and want to close it. Problem
is, when I record the "open filename", it puts that one filename in my macro
as literal, rather than the cell address. I need that to be variable. As is,
even when a different date is entered by user, it still keeps opening the
same file cuz it's recorded that way in the macro.



Relevant Pages

  • Re: Caching?
    ... And regardless of why I changed the filename, ... when I deleted the file altogether, the macro would not finish. ... Filesearch just might return the old-name of a renamed file. ... Public Sub ImportFiles() ...
    (microsoft.public.excel.programming)
  • Re: Help end the testing tedium please
    ... The new macro is crashing at: ... The filename and sheet name look fine. ... two arguments needed for "Consolidate". ... the file really were test1 thru test60, would the array statement need ...
    (microsoft.public.excel.programming)
  • Re: Help end the testing tedium please
    ... You didn't answer my questions as to whether, if a macro bombs, if the stuff ... Look at the utility worksheet in columns G and I like the code below ... The filename and sheet name look fine. ... that question that confuses you on the B = A thing: ...
    (microsoft.public.excel.programming)
  • Re: 64k row limit
    ... Seems it's not the macro, but an EOF character that is causing the hang-up. ... Dim ResultStr As String ... Dim FileNum As Integer ... FileName = Application.GetOpenFilename ...
    (microsoft.public.excel.worksheet.functions)
  • Re: How to insert an image file into Work AND have the file name d
    ... Selection.InsertAfter vbCr & FileName ... There's nothing the macro can do to find out what the others were. ... Picture> From File dialog, multiple-selected pictures don't get ...
    (microsoft.public.word.docmanagement)