Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
My code for export is:
sub Export_CrtneKode
Timestamp = Year(Date())&"-"&Month(Date())&"-"&Day(Date())
'Create the Excel spreadsheet
Set excelFile = CreateObject("Excel.Application")
excelFile.Visible = false 'or false to run in background
'Create the WorkBook
Set curWorkBook = excelFile.WorkBooks.Add
'Create the Sheet
'first chart object
Set curSheet = curWorkBook.WorkSheets(1)
'paste the object
Set i = ActiveDocument.GetSheetObject("CH02")
i.CopyTableToClipboard true
curSheet.Cells(1, 1).Select
curSheet.Paste
'to clear the clipboard
curSheet.Cells(1, 100).Copy
'define all cells format
curSheet.Columns("A").EntireColumn.NumberFormat = "0"
curSheet.Columns(2).ColumnWidth = 50
curSheet.Columns("B").EntireColumn.NumberFormat = "@"
curSheet.Columns("C").EntireColumn.NumberFormat = "@"
curSheet.Columns("D").EntireColumn.NumberFormat = "0"
curSheet.Columns(5).ColumnWidth = 20
curSheet.Columns("E").EntireColumn.NumberFormat = "@"
curSheet.Columns("F").EntireColumn.NumberFormat = "@"
curSheet.Columns("G").EntireColumn.NumberFormat = "@"
curSheet.Columns("H").EntireColumn.NumberFormat = "@"
excelFile.Visible = true
'Save the file and quit excel
excelFile.DisplayAlerts = False
curWorkBook.SaveAs "S:\Porocanje QlikView\Izdelki Farmadent\ČRTNE KODE FD"&" "×tamp&".xlsx"
excelFile.DisplayAlerts = True
curWorkBook.Close
excelFile.Quit
'Cleanup
Set curWorkBook = nothing
Set excelFile = nothing
end sub
Column E is EAN code formatted as text. After export the cell is displayed e.g. 6,94952E+12 instead of 6949517000018.
Any idea how can I solve this?
TIA, Igor
Thx....:-)