| |
|
|
- Page 1 - |
|
 Stephan Sonneborn | Hello together, in a Excel-Tabellenblatt (Stückliste) should item eigetragen go. the results to that one To foot, to that others through one Auswahlprogramm with provided Artikeln. The Excel Presentation has a primitiven protection against unbeabsichtigtes Überschreiben falser boxes: Blattschutz without Password.
for the händische Edit the Stückliste have I one macro written, that whom Blattschutz aufhebt, a Leerzeile einfügt and then whom Blattschutz again setting. In VBA is the then: ActiveSheet.Unprotect
at that Übertragen the Artikeldaten into Excelblatt by oxc must the Blattschutz too aufgehoben his. the wished I so manage:
'*-------------------------------------------------------------------------------------------------*
'* Exceldatei open *
'*-------------------------------------------------------------------------------------------------*
PROC OpenExcelFile
'*-------------------------------------------------------------------------------------------------*
PARAMETERS File$
'*-------------------------------------------------------------------------------------------------*
DECLARE UsedRange&, Rows&
'*-------------------------------------------------------------------------------------------------*
IF FILEEXISTS(File$)
'Excel invisible started:
Excel& = ocxCREATE("Excel.Application")
Workbooks& = ocxGet(Excel&,"Workbooks")
ExcelWnd& = ocxGet(Excel&,"Hwnd")
ocxPut(Excel&,"DisplayAlerts",1)
ocxPut(Excel&,"Visible" ,1)
'*-------------------------------------------------------------------------------------------------*
'Excel-Open File:
ExcelBook& = ocxMethod(Workbooks&,"Open" , File$)
ExcelSheet& = ocxGet(ExcelBook&, "Sheets", ExcelSheet$)
ocxPut(ExcelSheet&, "Unprotect")
Range& = ocxGet(ExcelSheet&, "Range", "A1")
UsedRange& = ocxGet(ExcelSheet&, "UsedRange")
Rows& = ocxGet(UsedRange&, "Rows")
ExcelSheetLines& = ocxGet(Rows&, "Count")
LastBOMPos& = INT((ExcelSheetLines& - 19)/4)
ELSE
ExcelWnd& = 0
ENDIF
'*-------------------------------------------------------------------------------------------------*
'Return Value:
RETURN ExcelWnd&
'*-------------------------------------------------------------------------------------------------*
ENDPROC
'*-------------------------------------------------------------------------------------------------*
unfortunately lead the to that Programmabsturz. has someone a idea? It's all right only around the entry ocxPUT(ExcelSheet&, "Unprotect"). without these row runs the code. |
|
|
| Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 02/06/11 ▲ |
|
|
|
 |
« this Posting watts as Solution marked. » |
|
 Stephan Sonneborn |  has it!
simply instead of ocxPut ocxMethod take:
'*-------------------------------------------------------------------------------------------------*
'* Exceldatei open *
'*-------------------------------------------------------------------------------------------------*
PROC OpenExcelFile
'*-------------------------------------------------------------------------------------------------*
PARAMETERS File$
'*-------------------------------------------------------------------------------------------------*
DECLARE UsedRange&, Rows&
'*-------------------------------------------------------------------------------------------------*
IF FILEEXISTS(File$)
'Excel invisible started:
Excel& = ocxCREATE("Excel.Application")
Workbooks& = ocxGet(Excel&,"Workbooks")
ExcelWnd& = ocxGet(Excel&,"Hwnd")
ocxPut(Excel&,"DisplayAlerts",1)
ocxPut(Excel&,"Visible" ,1)
'*-------------------------------------------------------------------------------------------------*
'Excel-Open File:
ExcelBook& = ocxMethod(Workbooks&,"Open" , File$)
ExcelSheet& = ocxGet(ExcelBook&, "Sheets", ExcelSheet$)
ocxMethod(ExcelSheet&, "Unprotect")
Range& = ocxGet(ExcelSheet&, "Range", "A1")
UsedRange& = ocxGet(ExcelSheet&, "UsedRange")
Rows& = ocxGet(UsedRange&, "Rows")
ExcelSheetLines& = ocxGet(Rows&, "Count")
LastBOMPos& = INT((ExcelSheetLines& - 19)/4)
ELSE
ExcelWnd& = 0
ENDIF
'*-------------------------------------------------------------------------------------------------*
'Return Value:
RETURN ExcelWnd&
'*-------------------------------------------------------------------------------------------------*
ENDPROC
'*-------------------------------------------------------------------------------------------------*
|
|
|
| Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 02/06/11 ▲ |
|
|
 |
|
|
 | Very calm, have soeben a offshoots with Codesnippets prepares: [...]  |
|
|
| |
|
|