Asked by chtullu135
at 2024-06-14 10:54:48
Point:500 Replies:3 POST_ID:828338USER_ID:11133
Topic:
Microsoft Visual Basic.Net;Microsoft Office Suite;Microsoft Excel Spreadsheet Software
I am triying to insert a column into an excel sheet via vb.net. I've run the macro recorder to get a start on the code and and am trying to modify the resulting code so that it would work within vb.net. However I am getting an error on "xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove" The error says that xlToRight and xlFormatFromLeftOrAbove are not declared.
aWorkSheet.Columns("B:B").Select()
aWorkSheet.Selection.Insert(Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove)
aWorkSheet.Columns("B:B").Select()
aWorkSheet.Selection.Insert(Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove)