Sign in to follow this  
Followers 0
Chimaera

Make csv to open in excel with colums open

6 posts in this topic

Im creating a csv from some array data of uninstall keys like this (needs Beta)

$sString = _ArrayToString($aList, ",", Default, Default, @CRLF) ; Make into .csv format Beta needed

FileWrite(@ScriptDir & '\Uninstall Logs\' & @OSVersion & ' ' & @UserName & ' ' & @MDAY & ' ' & @MON & ' ' & @MIN & ' ' & @SEC & '.csv', $sString)
MsgBox(64,'Finished', 'CSV Created', 2)

When i open it in excel 2013 it has the cells collapsed is there a way to make the csv remember to have colums maxed to the text within them?

Share this post


Link to post
Share on other sites



Cant find anything in either helpfile for that and from googling it appears to be an excel component?

I am only opening them with excel to read them not saving them with it

When i take the log (csv) they may not have excel installed.

I need it to be a csv component that is remembered when it is opened in excel

Share this post


Link to post
Share on other sites

You can't do that with a CSV. A CSV only contains data, no formatting information.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

You can't do that with a CSV. A CSV only contains data, no formatting information.

agreed. A CSV is really nothing more than a comma delimited file. Definition:

A comma-separated values (CSV) (also sometimes called character-separated values, because the separator character does not have to be a comma) file stores tabular data (numbers and text) in plain-text form.

 

Share this post


Link to post
Share on other sites

Ok thats a bust then

I will have to look at writing something that sits in the log folder and i run it before i start work on the logs

Open the csv, save them as excel on a loop and set the parameter (ActiveSheet.UsedRange.Columns.AutoFit) then close them

That seems to be the only sensible way 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0