Simple line error msg

  • Thread starter Thread starter James8309
  • Start date Start date
J

James8309

Hi everyone,

one of my line in my VBA code is ;

Workbooks.Open Filename:="G:\ReportFiles\ReportTemplate.xls"


and I do not understand why this line creates "Invalid Procedure call
or argument"

Please help

thank you,
 
If the path and file exists then the code line is correct. Are you
assigning this to a object? If so use

Set wbkNew = Workbooks.Open ("G:\ReportFiles\ReportTemplate.xls")
 
If the path and file exists then the code line is correct.  Are you
assigning this to a object? If so use

Set wbkNew =  Workbooks.Open ("G:\ReportFiles\ReportTemplate.xls")

--

Regards,
Nigel
(e-mail address removed)











- Show quoted text -


Directory is there, file is there, It even opens up when I execute the
macro but after opening the file, it returns the same error. Even if I
use your code it creates an error. When I click debug to see where the
error occured, it is the same line.

Is this because of the excel file that I am trying to open ?

I am only doing this because I have a seperate macro that need to be
done in :="G:\ReportFiles\ReportTemplate.xls"

Is there anyway I can run the macro from other workbook in the current
workbook?

if I do "Application.Run "ReportTemplate.xls'!Macro_B" will it work?
 
Did you create any subroutines/functions called Open?
Did you name any of your modules Open?
 
Sorry, I don't have another guess.

Does the code work in a brand new workbook's project?

I bet it does, so there's something bad going on in that original workbook.
 

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

Back
Top