Thread: Error 1004
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Francis Ang[_3_] Francis Ang[_3_] is offline
external usenet poster
 
Posts: 75
Default Error 1004

I am not sure where I have gone wrong with codes below. Every time I run it, I get a run time error 1004 ... the macro cannot be found; but the macro file is there!

file_name = Userform1.ListBox1.Value & ".xla"
pgm2run = file_name & "!StartPgm"

Workbooks.Open Filename:=file_name
Application.Run pgm2run

I am using Excel 2002 on Windows XP Professional. PLease help. TIA