Re: Constant as network drive

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Windows(something).activate
doesn't depend on the path--mapped or UNC.

You only use the filename (Book1.xls, not c:\my documents\excel\book1.xls).

Ps.

I try my best to not use the windows collection. I'll go through the workbooks
collection. And if my code opens the workbook:

Dim wkbk as workbook
set wkbk = workbooks.open(filename:=somefilenamehere)
....
I can use:
wkbk.activate

But be aware that most things can be done without activating or selecting.

Merlynsdad wrote:

I have an Excel file which needs to access another Excel file on a network. I
want to write the filename as a constant. This works fine when the constant
refers to a file on my local drive, but if the constant refers to a network
drive, when the code gets to "Windows (constant).Activate" it fails. How do I
get this to refer to a file on a network drive?

--

Dave Peterson
.



Relevant Pages

  • Constant as network drive
    ... I have an Excel file which needs to access another Excel file on a network. ... want to write the filename as a constant. ... refers to a file on my local drive, but if the constant refers to a network ...
    (microsoft.public.excel.programming)
  • Re: Macro to change linked object source file
    ... "test.xls"', using whatever the real filename is, minus the path. ... [MVP - Microsoft Word] ... original excel file name in the item section of the linked object. ...
    (microsoft.public.word.vba.general)
  • textbook problems on H I/O (beginner)
    ... filename is given as an input to this function in csv1. ... Write the resultant array to the filename ... that is given as an input to this function in csv2 as a csv file. ... Read in an Excel file whose filename is ...
    (comp.soft-sys.matlab)
  • Re: Open multiple excel spreadsheet from ppt VBA
    ... set wksheet1=XLApplication.workbooks.open(excel filename as ... But I don't know how to open another worksheet from the same excel file. ... workbook. ...
    (microsoft.public.powerpoint)
  • Re: gui/excel/array
    ... select an excel file. ... filesep is a function that returns the appropriate file seperator. ... FileName) ... To put the filename into the array, or to put the data into ...
    (comp.soft-sys.matlab)