Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
content on textbox within userform
Hi,
ChDir "L:\Atla" Workbooks.OpenText Filename:="L:\Atla\week32.xls" I would like to replace the filename above with the values of three textboxes which are within a userform. This should happen when I click "ok" in the userform. Name of userform is newweek and name of textboxes are file1, file2 and file3 reason is that there are new weeks and therefore new files... Is it possible to do something with the L above? I mean you can map the disk with something else than L depending on user. many thanks Sverre |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
content on textbox within userform
With Newweek
s = "L:\" & .file1.text & "\" & .file2.text & "\" & .file3.text &"\" End with chdrive "L" chdir s workbooks.Open "Week32.xls" is one interpretaton Another would be that you want to open 3 files listed in the textboxes Dim bk1 as Workbook, bk2 as Workbook, bk3 as Workbook chDrive "L" chdir "L:\Atla" With Newweek set bk1 = workbooks.open( .file1.text) set bk2 = Workbooks.open( .file2.text) set bk3 = Workbooks.open( .file3.text) End with You show the extension as being .xls, so I would use the Open method rather than open text if this indicates they are excel files. -- Regards, Tom Ogilvy "sverre" wrote: Hi, ChDir "L:\Atla" Workbooks.OpenText Filename:="L:\Atla\week32.xls" I would like to replace the filename above with the values of three textboxes which are within a userform. This should happen when I click "ok" in the userform. Name of userform is newweek and name of textboxes are file1, file2 and file3 reason is that there are new weeks and therefore new files... Is it possible to do something with the L above? I mean you can map the disk with something else than L depending on user. many thanks Sverre |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
content on textbox within userform
As always an excellent answer that works immediately!
Many thanks Tom! Sverker "Tom Ogilvy" skrev: With Newweek s = "L:\" & .file1.text & "\" & .file2.text & "\" & .file3.text &"\" End with chdrive "L" chdir s workbooks.Open "Week32.xls" is one interpretaton Another would be that you want to open 3 files listed in the textboxes Dim bk1 as Workbook, bk2 as Workbook, bk3 as Workbook chDrive "L" chdir "L:\Atla" With Newweek set bk1 = workbooks.open( .file1.text) set bk2 = Workbooks.open( .file2.text) set bk3 = Workbooks.open( .file3.text) End with You show the extension as being .xls, so I would use the Open method rather than open text if this indicates they are excel files. -- Regards, Tom Ogilvy "sverre" wrote: Hi, ChDir "L:\Atla" Workbooks.OpenText Filename:="L:\Atla\week32.xls" I would like to replace the filename above with the values of three textboxes which are within a userform. This should happen when I click "ok" in the userform. Name of userform is newweek and name of textboxes are file1, file2 and file3 reason is that there are new weeks and therefore new files... Is it possible to do something with the L above? I mean you can map the disk with something else than L depending on user. many thanks Sverre |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UserForm1 Not Displaying Textbox Content | Excel Programming | |||
Check the content of a textbox? | Excel Programming | |||
Textbox Content Type | Excel Programming | |||
Copy a cell content into a TextBox | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |