View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Tony Girgenti Tony Girgenti is offline
external usenet poster
 
Posts: 21
Default Excel workbook save behavior using VB6 very confusing

Hello kounoike.

That was it. It was Autofitting without the data ini it.

Thanks for all of your help.
Tony

"kounoike" wrote:

I don't know what DataArray is. but it's seems that you do autofit to
columns("A:L") before you put data in range("A2:L2"). so i doubt about that
it works all well when you don't need create a new workbook and don't in
other case. i think you shoud do autofit after you put the data into the
range.

keiji

"Tony Girgenti" wrote in message
...
Hello.

I'm using VB6.0, SP6 and Excel 2003 to open an Excel workbook, put data
into
it, format it and save it. I have placed my module at the end of this
post.

When i run the program and the Excel spreadsheet already exists it does
all
of the data and formatting correctly. If i run the program and the
spreadsheet needs to be created, it puts the data in, but the last part of
the formatting is not done. Namely:
newExcelWorkSheet.Columns("A:L").Select
Selection.Columns.AutoFit

Can anybody explain how to fix this? I want all data and formatting to be
applied whether the spreadsheet already exists or not.

Any help would be gratefully appreciated.

Thanks,
Tony


- snip -