Prev: Controls in protected sheet don't response!!!
Next: Excel 2007 "Protect Sheet" option not available
From: FIRSTROUNDKO via OfficeKB.com on 14 May 2010 06:39 Hi, have a workbook abc****.xls in c:\myfolder\ I want to open it **** is of variable length I think I need to use something like Workbooks.Open Filename:= c:\myfolder\ or maybe should I call the abc****.xls to a cell first Thanks in advance -- Message posted via http://www.officekb.com
From: joel on 14 May 2010 06:52 FName = dir("c:\myfolder\*.xls") set bk = Workbooks.Open( Filename:= FName) -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=202762 http://www.thecodecage.com/forumz
From: Dave Peterson on 14 May 2010 08:11 Dim TestStr as string dim wkbk as workbook teststr = "" on error resume next teststr = dir("C:\myfolder\abc*.xls") on error goto 0 if teststr = "" then 'nothing found, what should happen else set wkbk = workbooks.open(filename:="C:\myfolder\" & teststr) 'do stuff with wkbk??? end if On 05/14/2010 05:39, FIRSTROUNDKO via OfficeKB.com wrote: > Hi, > > have a workbook abc****.xls in c:\myfolder\ > > I want to open it > > **** is of variable length > > I think I need to use something like > > Workbooks.Open Filename:= c:\myfolder\ > > or maybe should I call the abc****.xls to a cell first > > Thanks in advance >
From: FIRSTROUNDKO via OfficeKB.com on 14 May 2010 09:50 Thank You, Perfect! Dave Peterson wrote: >Dim TestStr as string >dim wkbk as workbook > >teststr = "" >on error resume next >teststr = dir("C:\myfolder\abc*.xls") >on error goto 0 > >if teststr = "" then > 'nothing found, what should happen >else > set wkbk = workbooks.open(filename:="C:\myfolder\" & teststr) > 'do stuff with wkbk??? >end if > >> Hi, >> >[quoted text clipped - 11 lines] >> >> Thanks in advance -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.aspx/excel-programming/201005/1
|
Pages: 1 Prev: Controls in protected sheet don't response!!! Next: Excel 2007 "Protect Sheet" option not available |