基本上,标题。我打开并对.csv进行更改(如果有人可以正常保存,我可以正常使用excel文件)文件(具体来说,自动调整和加粗所有内容),但当我去打开文件时,没有任何内容已经改变。谁知道为什么?老实说,我不知道我在做什么:p和互联网似乎没有任何关于此的信息。
作为旁注,如果.exe在运行时崩溃,然后我打开excel文件,它的格式正确。这是代码:
Dim spreadsheet As Excel.Application
Set spreadsheet = CreateObject("Excel.Application")
spreadsheet.Workbooks.Open _
FileName:=exportPath, _
ReadOnly:=False
Call spreadsheet.ActiveSheet.UsedRange.Select
Call spreadsheet.Selection.Columns.AutoFit
spreadsheet.Selection.Font.Bold = True
spreadsheet.ActiveWorkbook.SaveCopyAs (App.Path & "\" & "THISONE" & gc_AppName & "EXPORT" _
& Format$(Now, "yyyy/mm/dd/hhmm") & gc_ExportExtension)
MsgBox (spreadsheet.ActiveWorkbook.ActiveSheet.Cells(1, 1).Value)
Call spreadsheet.SaveWorkspace
'Call spreadsheet.ActiveSheet.Save
Call spreadsheet.ActiveWorkbook.Save
Call spreadsheet.ActiveWorkbook.Close(True)
Set spreadsheet = Nothing