Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Method Range of object '_Global' failed
Hi , I have been trying to autofill dates of the month for particular sheet, but it throws me this error Method Range of objec '_Global' failed. The following code snippet is what iam using 'Fill in the Dates for the Month in the first column objExcelRep.Worksheets("DataMatrix").Cells(intCell IndexRow, 1) Month(Date) & "/01/" & Year(Date) objExcelRep.Worksheets("DataMatrix").Cells(intCell IndexRow 1).Select strRange = "A" & intCellIndexRow & ":A" & intCellIndexRow MonthNoOfDays - 1 Selection.AutoFill Destination:=Range(strRange), Type:=xlFillDays Am i missing something? Thanks, Joh -- maverick200 ----------------------------------------------------------------------- maverick2005's Profile: http://www.excelforum.com/member.php...fo&userid=2662 View this thread: http://www.excelforum.com/showthread.php?threadid=39902 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Method Range of object '_Global' failed
Am i missing something? Yes. Probably the parent sheet for the Range in the last line. Selection.AutoFil Destination:=Worksheets("YOUR_SHEET_NAME").Range(s trRange) Type:=xlFillDays Manges -- mangesh_yada ----------------------------------------------------------------------- mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047 View this thread: http://www.excelforum.com/showthread.php?threadid=39902 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Method Range of object '_Global' failed
I tried this Range("A" & intCellIndexRow).AutoFil Destination:=objExcelRep1.Worksheets("DataMatrix") .Range(strRange) Type:=xlFillDays and still it throws me the same "_global" error. Thanks, Joh -- maverick200 ----------------------------------------------------------------------- maverick2005's Profile: http://www.excelforum.com/member.php...fo&userid=2662 View this thread: http://www.excelforum.com/showthread.php?threadid=39902 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Method Range of object '_Global' failed
this worked for me:
Sub ABC() Set ObjExcelRep = ActiveWorkbook intCellIndexRow = 5 MonthNoOfDays = Day(DateSerial( _ Year(Date), Month(Date) + 1, 0)) ObjExcelRep.Activate ObjExcelRep.Worksheets("DataMatrix").Select ObjExcelRep.Worksheets("DataMatrix") _ .Cells(intCellIndexRow, 1) = Month(Date) & "/01/" _ & Year(Date) ObjExcelRep.Worksheets("DataMatrix") _ .Cells(intCellIndexRow, 1).Select strRange = "A" & intCellIndexRow & ":A" & _ intCellIndexRow + MonthNoOfDays - 1 Selection.AutoFill Destination:=Range(strRange), _ Type:=xlFillDays End Sub -- Regards, Tom Ogilvy "maverick2005" wrote in message news:maverick2005.1ubmqj_1124975155.7962@excelforu m-nospam.com... I tried this Range("A" & intCellIndexRow).AutoFill Destination:=objExcelRep1.Worksheets("DataMatrix") .Range(strRange), Type:=xlFillDays and still it throws me the same "_global" error. Thanks, John -- maverick2005 ------------------------------------------------------------------------ maverick2005's Profile: http://www.excelforum.com/member.php...o&userid=26627 View this thread: http://www.excelforum.com/showthread...hreadid=399026 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Method 'Range' of object '_global' failed | Excel Discussion (Misc queries) | |||
What does XLS VB Method 'Range of object' _Global failed mean? | Excel Programming | |||
<Method 'Range' of object '_Global' failed error | Excel Programming | |||
Method 'Range' of object '_Global' failed | Excel Programming | |||
Method 'Range' of object '_Global' failed | Excel Programming |