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: 47
Default put path in as variable

I need this sub to allow me to specify the path to the
file I want to open here so that no matter what the
current path is, it will find this file. It works in cases
where this path is already the current path, but the open
file fails if another folder is the active path.
But this sub refuses to do what I want it to do. It just
keeps insisting an object is required on the line where I
set path = "D:\....

If I remove the " ", then it highlights the "/" and says
something about expects a line number. I wish this thing
would learn to speak English for a change.


Sub Import()
Dim cRows As Long
Dim path As String
Set path = "D:\myfiles\data\ttax\"
Sheets("Import").Select
Application.Goto Reference:=("Importarea")
Selection.CurrentRegion.Clear
Range("A1").Select
Workbooks.Open Filename:="path" & "LUSE.WK1"

Thanks,


Bruce
 
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
Excel variable for path Esgrimidor New Users to Excel 3 September 5th 09 09:15 PM
variable path Gerardo Links and Linking in Excel 1 June 12th 09 05:38 AM
Vlookup using variable path name for range value Jeff Lowenstein Excel Worksheet Functions 1 February 9th 06 01:13 AM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
make a vlookup using a variable path Alex St-Pierre Excel Worksheet Functions 1 March 2nd 05 11:54 PM


All times are GMT +1. The time now is 10:29 AM.

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

About Us

"It's about Microsoft Excel"