Domino 9 und frühere Versionen > Entwicklung
einfügen eines Wertes in Excel sheet
(1/1)
seerow:
Hallo zusammen,
ich möchte in einen Export2Excel script gerne noch die folgende Funktion einbauen.
Nach der Formatierung des Excel sheets soll in die Zelle A1 ein Wert geschrieben werden (siehe Pfeile).
Leider beendet das script den Import mit der Fehlermeldung "Error 182 occured whilst formatting the spreadsheet, execution aborted"
.
.
.
.
currentprocess = "creating an Excel spreadsheet"
Set handle = CreateObject("Excel.Application")
handle.visible = True
handle.Workbooks.Open(filename)
Set wsheet = handle.Application.Workbooks(1).Worksheets(1)
'format spreadsheet
currentprocess = "formatting the spreadsheet"
wsheet.Name = viewname
wsheet.Cells.Font.Size = 8
wsheet.Rows("1:1").Select
wsheet.Rows("1:1").Font.Bold = False
wsheet.Cells.EntireColumn.Autofit
'return to cell A1 for tidyness
wsheet.Range("A1").Select
-----> 'wsheet.Selection.EntireRow.Insert
-----> wsheet.ActiveCell.FormulaR1C1 = "asset_db ## this is an working asset importsheet"
.
.
.
.
Axel:
Hi,
warum machst du es denn nicht so?
wSheet.Range("A1").Value = "Wert"
Axel
seerow:
hm ::) Stimmt, jetzt geht es.....danke
Aber wie bekomme ich noch eine zeile Über zelle A1 eingefügt??
wsheet.Selection.EntireRow.Insert funktioniert leider nicht
Axel:
Hi,
versuch's mal mit der Insert-Methode des Range-Objectes. Angaben zu den Parametern findest du in der Excel-VBA - Hilfe.
Axel
seerow:
so gehts...... ;D
'format spreadsheet
currentprocess = "formatting the spreadsheet"
wsheet.Name = viewname
wsheet.Cells.Font.Size = 8
wsheet.Rows("1:1").Select
wsheet.Rows("1:1").Font.Bold = False
wsheet.Cells.EntireColumn.Autofit
'return to cell A1 for tidyness
---->wsheet.Range("A1").Select
---->wsheet. Rows("1:1").Insert
---->wSheet.Range("A1").Value = "Wert"
Navigation
[0] Themen-Index
Zur normalen Ansicht wechseln