Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.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
如何使用vb.net在Excel中设置Wordwrap_Excel_Vb.net - Fatal编程技术网

如何使用vb.net在Excel中设置Wordwrap

如何使用vb.net在Excel中设置Wordwrap,excel,vb.net,Excel,Vb.net,我已经研究了提供的解决方案,并尝试了它们,但没有成功。我觉得我错过了什么。未找到类型“工作表”上的公共成员“wordwrap”时出现以下错误 提前谢谢 这是代码的一部分 Dim oExcel As Object Dim oBook As Object Dim oSheet1 As Object oExcel = CreateObject("Excel.Application") oBook = oExcel.workbooks.add oSheet1 =

我已经研究了提供的解决方案,并尝试了它们,但没有成功。我觉得我错过了什么。未找到类型“工作表”上的公共成员“wordwrap”时出现以下错误

提前谢谢

这是代码的一部分

Dim oExcel As Object
    Dim oBook As Object
    Dim oSheet1 As Object
    oExcel = CreateObject("Excel.Application")
    oBook = oExcel.workbooks.add
    oSheet1 = oBook.Worksheets(1)
    oSheet1.name = "ProjectPlan"

    oSheet1.Select
    oSheet1.Columns("C:C").Select
    With oSheet1
        .wordwrap = True
    End With
使用:

就你而言:

Sheet.Columns("C:C").WrapText = True
带有oSheet1。ColumnsC:Cor带有oSheet1。单元格用于该表上的所有单元格。
Sheet.Columns("C:C").WrapText = True