Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi everyone...
i have a little problem.. i´m testing if a workbooks exists and then if he is already open...the problem is my application lose about 20 seconds with this test. is there any other way for this test that gives me some more speed? what i do is this: If (fs.FileExists(wb) = True) Then If IsOpen = True Then 'a function that tests if the workbook is already open Workbooks(wb).Close SAVECHANGES:=False End If Workbooks.Open Filename:= wb end if thanks in advance Miguel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try this idea I use from a double click event where the file name is typed
in a cell. Sub GetWorkbook() If ActiveCell.Value = "" Then Exit Sub workbookname = ActiveCell.Value On Error GoTo OpenWorkbook Windows(workbookname & ".xls").Activate Exit Sub OpenWorkbook: Workbooks.Open(workbookname & ".xls").RunAutoMacros xlAutoOpen End Sub -- Don Guillett SalesAid Software "Liedson31" wrote in message ... hi everyone... i have a little problem.. i´m testing if a workbooks exists and then if he is already open...the problem is my application lose about 20 seconds with this test. is there any other way for this test that gives me some more speed? what i do is this: If (fs.FileExists(wb) = True) Then If IsOpen = True Then 'a function that tests if the workbook is already open Workbooks(wb).Close SAVECHANGES:=False End If Workbooks.Open Filename:= wb end if thanks in advance Miguel |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Liedson31" wrote in message
... hi everyone... i have a little problem.. i´m testing if a workbooks exists and then if he is already open...the problem is my application lose about 20 seconds with this test. is there any other way for this test that gives me some more speed? what i do is this: If (fs.FileExists(wb) = True) Then If Not CBool(Len(Dir("[name and path of file]"))) Then If IsOpen = True Then 'a function that tests if the workbook is already open Workbooks(wb).Close SAVECHANGES:=False End If Workbooks.Open Filename:= wb end if |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Testing | Excel Discussion (Misc queries) | |||
Slow Excel Navigation with Up / Down Arrow and slow scrolling | Excel Discussion (Misc queries) | |||
testing for #NA with VBA | Excel Programming | |||
testing | Excel Worksheet Functions | |||
just testing | Excel Programming |