Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Set workSheet=workSheets.WorkSheets(2)
- 'Set oSH = oXL.ActiveSheet
- ''Блок имени листа
- workSheet.Name="Доли ТовКат"
- container="CT120_832496997"
- EntireCont=Array("CH531_321692226","CH547_187156428","CH538","CH536","CH542_243845106","CH574_301042769","CH539","CH537")
- bb=0
- cc=0
- countRow=2
- For j=0 to UBound(EntireCont)
- Set objCont = ActiveDocument.GetSheetObject(container)
- Set objProp = objCont.GetProperties
- objProp.SingleObjectActiveIndex = j
- objCont.SetProperties objProp ''Ставим активным первую таблицу первого контейнера
- Set obj = ActiveDocument.GetSheetObject(EntireCont(j))
- if j<>2 and j<>6 then
- obj.CopyTableToClipboard True
- else
- msgbox("Обработка изображения...")
- timestamp = Year(Now())&"_"&Month(Now())&"_"&Day(Now())&"_"&Hour(Now())&"_"&Minute(Now())&"_"&Second(Now())
- sPath="C:\Windows\Temp\"×tamp&".png"
- 'msgbox jpgName
- 'ExportObjectToJpg EntireCont(j), sPath
- ActiveDocument.GetSheetObject(EntireCont(j)).ExportBitmapToFile sPath
- 'obj.CopyBitMapToClipboard
- end if
- sCaption=obj.GetCaption.Name.v
- if j<4 then
- if j=2 then
- 'msgbox("A"&countRow)
- workSheet.Range("A"&countRow).Select
- workSheet.Pictures.Insert(sPath)
- else
- workSheet.Paste workSheet.Range("A"&countRow) ''Вставляем в Excel
- end if
- else
- if j=6 then
- workSheet.Range(letter&countRow).Select
- workSheet.Pictures.Insert(sPath)
- else
- workSheet.Paste workSheet.Range(letter&countRow) ''Вставляем в Excel
- end if
- end if
- cc = obj.GetRowCount ''Временно сохраняем количество строк в таблице
- if bb<obj.GetColumnCount then
- bb = obj.GetColumnCount
- end if
- letter=getColumnNameByIndex(bb+8)
- countRow=countRow-1
- if j<4 then
- workSheet.Cells(countRow,1).Value=sCaption
- workSheet.Cells(countRow,1).Font.Bold=True
- workSheet.Cells(countRow,1).Font.Size=14
- else
- workSheet.Cells(countRow,bb+8).Value=sCaption
- workSheet.Cells(countRow,bb+8).Font.Bold=True
- workSheet.Cells(countRow,bb+8).Font.Size=14
- end if
- countRow=countRow+1
- if j=2 or j=6 then
- countRow=cc+countRow+7
- else
- countRow=cc+countRow+1
- end if
- if j=3 then countRow=2
- next 'j increment
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement