Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rob
 
Posts: n/a
Default Application prefix or not

when creating some code, via the record macro function I find that
sometimes, for it to run succesfully, I need to add "Application"
immediately before some of the lines.

eg. Range ("A1") would become Application.Range ("A1") for that line to be
accepted.
Can someone tell me why, and what the rule is here?

Rob


  #2   Report Post  
Jim Rech
 
Posts: n/a
Default

Range does not require a qualifier so I don't know why you're finding that
it does. From Help:

"When used without an object qualifier, this property is a shortcut for
ActiveSheet.Range (it returns a range from the active sheet"

--
Jim
"Rob" <NA wrote in message ...
when creating some code, via the record macro function I find that
sometimes, for it to run succesfully, I need to add "Application"
immediately before some of the lines.

eg. Range ("A1") would become Application.Range ("A1") for that line to be
accepted.
Can someone tell me why, and what the rule is here?

Rob



  #3   Report Post  
Rob
 
Posts: n/a
Default

I'm certainly not an expert at this and I only used Application from a
suggestion I received quite a long time ago for another code I was trying to
develop. I found that this code I'm working on also won't give the correct
result or proceed without it.
One thing which might make the difference is that the range being referred
to is in another workbook (open as the code runs) from the workbook running
the code.
I don't understand what is meant bt object qualifier and what that has to do
with this situation.

I generally start my code by recording a macro and then adding/modifying as
I know how (which is quite limited).
The macro recorded records the process well but when I try and run it, it
stops at odd lines and when I add Application to those lines it seems to
work fine. It's very confusing and I just wondered why and if maybe I was
doing something wrong for me to require this.

I don't always have this problem when using range, but maybe it's because as
I said about the code referring to another workbook as when I use range to
refer to a cell within the workbook that's running the code, I don't need
the term Application as a prefix.

Rob

"Jim Rech" wrote in message
...
Range does not require a qualifier so I don't know why you're finding that
it does. From Help:

"When used without an object qualifier, this property is a shortcut for
ActiveSheet.Range (it returns a range from the active sheet"

--
Jim
"Rob" <NA wrote in message ...
when creating some code, via the record macro function I find that
sometimes, for it to run succesfully, I need to add "Application"
immediately before some of the lines.

eg. Range ("A1") would become Application.Range ("A1") for that line to
be accepted.
Can someone tell me why, and what the rule is here?

Rob





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
Adding a prefix to a cell by using a formula Audrey in OHIO Excel Discussion (Misc queries) 4 February 24th 05 04:49 PM
Convert excel spreadsheet application to a java or .Net Experience excel to java or .net Excel Discussion (Misc queries) 0 February 23rd 05 06:43 PM
Cannot start the source application for this object Excel General Questions Excel Discussion (Misc queries) 0 February 2nd 05 07:05 PM
Excel application as an ERP platform for medium size production plan Adi Excel Discussion (Misc queries) 2 December 28th 04 03:25 PM
Where can I find a template for application report specifications. James Excel Discussion (Misc queries) 0 December 10th 04 06:19 AM


All times are GMT +1. The time now is 12:14 PM.

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"