Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;VBA错误438对象不存在';“不支持此属性或方法”;_Vba_Excel - Fatal编程技术网

&引用;VBA错误438对象不存在';“不支持此属性或方法”;

&引用;VBA错误438对象不存在';“不支持此属性或方法”;,vba,excel,Vba,Excel,我有一个很大的Excel文件,从数据库中检索数据并导出到Excel中,在Excel中形成图形。图形不同部分的颜色由一个函数控制,在该函数中,您在另一个工作表中填充一个单元格,并读取该单元格的代码。问题是,只要有一种颜色,代码就只能工作,现在我想使用我的模式,这样,格式单元格->填充->模式样式。我试图用这种方法解决它,但在带有括号的行中出现了运行时错误438。感谢所有的帮助 Else .FullSeriesCollection

我有一个很大的Excel文件,从数据库中检索数据并导出到Excel中,在Excel中形成图形。图形不同部分的颜色由一个函数控制,在该函数中,您在另一个工作表中填充一个单元格,并读取该单元格的代码。问题是,只要有一种颜色,代码就只能工作,现在我想使用我的模式,这样,格式单元格->填充->模式样式。我试图用这种方法解决它,但在带有括号的行中出现了运行时错误438。感谢所有的帮助

                Else
                   .FullSeriesCollection(i).ChartType = xlLineStacked
                   .FullSeriesCollection(i).Format.line.Weight = 2.5
                   .FullSeriesCollection(i).Format.line.ForeColor.rgb = _
                    getRGB(findInSub(setupLC, findInCategory(tables, _
                    Right(tbl.Name, Len(tbl.Name) - 3)).offset(0, 6), lineC, _
                    .SeriesCollection(i).Name))
                With Sheets("mysheet").Range("mycell")
             If .Cells.Interior.Pattern = -4142 Or .Cells.Interior.Pattern = 1 Then
             .FullSeriesCollection(i).Format.Fill.Patterned = .Interior.Color
             Else
              (.FullSeriesCollection(i).Format.Fill.Patterned = .Cells.DisplayFormat.Interior.PatternColor)
             End If
            End With
                End If
            End If
        Next i
    End With
End With

/Johan

我看到了一个问题:您正在使用
块调用
.FullSeriesCollection
,该块引用了一个范围,而
.FullSeriesCollection
不是范围对象的一部分。它是
图表
对象的一部分。您似乎有一些带有
块的
。我建议不要将
用于工作表(“mysheet”).Range(“mycell”)
用于
块,只需使用完全限定的引用即可访问
.Cells
(即
此工作簿.worksheet(“mysheet”).Range(“mycell”).Cells…
)。如果前面的
块引用的是
图表
对象

在代码中看不到“标记线”,这应该可以解决问题:)。请指定抛出错误的行。我不知道如何标记该行,所以现在它周围有括号。这个:(.FullSeriesCollection(i).Format.Fill.Patterned=.Cells.DisplayFormat.Interior.PatternColor)