Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding a prefix to a cell by using a formula | Excel Discussion (Misc queries) | |||
Convert excel spreadsheet application to a java or .Net Experience | Excel Discussion (Misc queries) | |||
Cannot start the source application for this object | Excel Discussion (Misc queries) | |||
Excel application as an ERP platform for medium size production plan | Excel Discussion (Misc queries) | |||
Where can I find a template for application report specifications. | Excel Discussion (Misc queries) |