|
-
Nov 9th, 2018, 10:29 AM
#2
Re: bangin my head: so close..format an excel workbooks column as number & save it
Take a look at this line:
 Originally Posted by rgouette
Code:
Dim xlWb As Microsoft.Office.Interop.Excel.Workbook = xlApp.Workbooks.Add
It is declaring the variable, and explicitly creating a new workbook. If you don't want the extra workbook (Book1), then remove the part of the code that creates it.
The line xlApp.Visible = True is probably something you don't want either (and instead replace it with closing the workbook and application objects), but it is probably wise to keep it for now.
I suspect the reason for the extra Save dialog is that the file is a CSV, which can only contain data (no formatting). I would assume that the dialog is not only prompting you to save, but also to change the file type to one that supports formatting (but it may only tell you that when you press save).
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|