Bug when calling sub within a sub

B

Barb Reinhardt

I am calling a sub that includes the input parameters, aws, awb, owb, ows and
mypattern (which is a string). We're having an inconsistent bug which
appears to occur when the owb is already opened and we reopen it. Has
anyone seen anything like this before and if so, what did you do to fix it?

Thanks,
Barb Reinhardt
 
B

Bernie Deitrick

Barb,

Post your code. You probably just need to check to see if it is open first.

HTH,
Bernie
MS Excel MVP
 
D

Dave Peterson

Do you have to reopen it?

Could you just check to see if it's already open and just not open it?

Dim testWb as workbook
set testwb = nothing
on error resume next
set testwb = workbooks("somenamehere--not including path.xls")
on error goto 0

if testwkb is nothing then
'open it
else
'don't open it
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top