Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Simple line error msg

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,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Simple line error msg

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




"James8309" wrote in message
...
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,


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Simple line error msg

On Jul 1, 3:55*pm, "Nigel" wrote:
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


"James8309" wrote in message

...



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,- Hide quoted text -


- 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?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Simple line error msg

Did you create any subroutines/functions called Open?
Did you name any of your modules Open?


James8309 wrote:

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,


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Simple line error msg

On Jul 1, 9:53*pm, Dave Peterson wrote:
Did you create any subroutines/functions called Open?
Did you name any of your modules Open?

James8309 wrote:

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,


--

Dave Peterson


Nope :(


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Simple line error msg

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.

James8309 wrote:

On Jul 1, 9:53 pm, Dave Peterson wrote:
Did you create any subroutines/functions called Open?
Did you name any of your modules Open?

James8309 wrote:

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,


--

Dave Peterson


Nope :(


--

Dave Peterson
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
can't create a simple Line Chart Ruuudy New Users to Excel 2 July 15th 09 12:53 PM
simple bar and line chart betsy Charts and Charting in Excel 1 February 12th 09 11:35 PM
Simple line fix request. sungen99[_37_] Excel Programming 4 January 25th 06 04:45 PM
Simple Question (insert new line) Joe D[_4_] Excel Programming 3 July 27th 05 03:52 PM
Missing a line (Simple) Jayhawktc[_4_] Excel Programming 1 August 11th 04 06:42 PM


All times are GMT +1. The time now is 09:29 AM.

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"