Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting Workbooks
After getting the user to select the file to open by:
fName = Application.GetOpenFilename Workbooks.Open Filename:=fName Any idea how can i refer to this workbook again later on in my code? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting Workbooks
Hi Darren
as long as you don't redefine fName Workbooks(fName).Activate or Workbooks(fName).Sheets("Sheet1").Select etc Cheers JulieD "Darren" wrote in message ... After getting the user to select the file to open by: fName = Application.GetOpenFilename Workbooks.Open Filename:=fName Any idea how can i refer to this workbook again later on in my code? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting Workbooks
dim wb as workbook
fName = Application.GetOpenFilename set wb=workbooks.open(fName) Tim "Darren" wrote in message ... After getting the user to select the file to open by: fName = Application.GetOpenFilename Workbooks.Open Filename:=fName Any idea how can i refer to this workbook again later on in my code? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting Workbooks
Thanks guys
|
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting Workbooks
Watch out.
fName will include the drive\path when it comes back from .getopenfilename. You could strip the drive\path out of the string, or use a variable like Tim suggested. JulieD wrote: Hi Darren as long as you don't redefine fName Workbooks(fName).Activate or Workbooks(fName).Sheets("Sheet1").Select etc Cheers JulieD "Darren" wrote in message ... After getting the user to select the file to open by: fName = Application.GetOpenFilename Workbooks.Open Filename:=fName Any idea how can i refer to this workbook again later on in my code? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Updating Workbooks from multiple links Workbooks | Excel Worksheet Functions | |||
Copy/ move selected data from workbooks to seperate worksheets or workbooks | Excel Worksheet Functions | |||
Display 2 formulas from source workbooks to destination workbooks | Excel Discussion (Misc queries) | |||
suddenly my excel workbooks are "shared workbooks" | Excel Discussion (Misc queries) | |||
Selecting Workbooks | Excel Programming |