View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jason Hancock Jason Hancock is offline
external usenet poster
 
Posts: 13
Default File Loading Problems

Okay, here is the problem. The code below crashes out at the
Windows(UFFN).Activate part. I think that the code is assigning False
to the UF instead of assigning the input from the selection window. Is
there some other way to make sure that the then statement runs when the
click Cancel.

While I'm thinking about it, is there some way to make sure the write
restriction password dialog box doesn't appear?

Dim UF As Variant
Dim UFFN As Variant
UF = Application.GetOpenFilename(Title:="This Weeks Projections for
Angie")
If UF < False Then

Workbooks.Open Filename:=UF

Set wbUF = Workbooks.Open(Filename:=UF,
WriteResPassword:="sue")
UFFN = wbUF.Name

Windows(UFFN).Activate
Sheets("Angie").Select
Sheets("Angie").Copy After:=Workbooks("Projection
Summary.xls").Sheets("Summary")
Windows(UFFN).Activate
ActiveWindow.Close
Windows("Projection Summary").Activate

Else

MsgBox "No projection forms selected for Angie. You must
add them manually later."


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!