VBInfinite Posted February 28, 2005 Posted February 28, 2005 Coder, I'm working on vb.net app that I want to do the following and hoping members can guide me to right direction. I want my program to be able to go to each excel files and expand the cell columns and if I click on 11 x 17, then my app will change excel print size to 11 x 17. Any idea? :confused: Thank you in advance all comments are welcome. :p Quote
Mike_R Posted February 28, 2005 Posted February 28, 2005 Well, changing the Worksheet's column width would look something like this:Dim xlWS As Worksheet = CType(xlApp.ActiveSheet, Excel.Worksheet) xlWS.Columns("A:C").ColumnWidth = 20 I've never changed the print settings to 11x17, but I guess it would look something like this:xlWS.PaperSize = Excel.XlPaperSize.xlPaper11x17 Hope this helps... -- Mike Quote Posting Guidelines Avatar by Lebb
VBInfinite Posted March 1, 2005 Author Posted March 1, 2005 Thank you, Mike I'll try it when i get home. Quote
Mike_R Posted March 1, 2005 Posted March 1, 2005 Sorry, it looks like I forgot a cast in the above. Try this when you get home:Dim xlWS As Excel.Worksheet = CType(xlApp.ActiveSheet, Excel.Worksheet) CType(xlWS.Columns("A:C"), Excel.Range).ColumnWidth = 20 -- Mike Quote Posting Guidelines Avatar by Lebb
Recommended Posts