Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Too slow testing

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Too slow testing

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Too slow testing

"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
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
Testing Jay T. Emory[_2_] Excel Discussion (Misc queries) 0 February 18th 09 08:55 PM
Slow Excel Navigation with Up / Down Arrow and slow scrolling deddog Excel Discussion (Misc queries) 0 August 14th 07 09:56 PM
testing for #NA with VBA Tim Kredlo Excel Programming 2 May 25th 05 09:28 PM
testing Juco Excel Worksheet Functions 2 January 31st 05 01:13 AM
just testing John Excel Programming 1 August 30th 04 05:16 AM


All times are GMT +1. The time now is 12:25 PM.

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"