Question:

VB.Net help: How do I change an excel column width using ColumnWidth method?

by  |  earlier

0 LIKES UnLike

I'm making a program that can creat an excel spreadsheet. I need to resize the column width of some of the cells in the work sheet.

Tried using the command:

myExcel.ColumnWidth = 3

But I'm getting a runtime error saying that "Public member 'ColumnWidth' on type 'ApplicationClass' not found."

What am i doing wrong here?

 Tags:

   Report

1 ANSWERS


  1. You are not telling the method which columns to modify.  If the columns are selected, then you probably should be using Selection.ColumnWidth = 3 or myExcel.Selection.ColumnWidth = 3.  If they are not, either select them or replace Selection in the code above with identification of which columns are to be altered.  It may also need to be told which worksheet [e.g. Sheets("Sheet1").Columns(4).]

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions