Коллеги, добрый день!
Собрал прямую таблицу с расчетами (расчеты в скрипте не возможны т.к. обращаются к полю ручного ввода непосредственно в модели)
Хочу ее сохранить в qvd, обновлять и обращаться к ней.
Сохранить её экспортом я конечно могу, но как это прописать в скрипте (из серии store Tmp1 into \\Mac\Home\Desktop\Затраты\personalcost.qvd (qvd);)
Ещё рассматриваю вариант использовать её в модели как внешнюю (правильно описать не могу), хочу обращаться к ней как к загруженной таблице
Подскажите как осуществить один из вариантов, а лучше оба)))
Нашел такой макрос, но он у меня не работает, не пойму почему:
sub ExpQVD
QVDFile = "\\Mac\Home\Desktop\Затраты\1111.qvd"
set obj = ActiveDocument.GetSheetObject("CH17")
obj.ExportEx QVDFile, 4
ActiveDocument.PartialReload
End Sub
Sub ExcelExpwCaption
'Set the path where the excel will be saved
filePath = "D:\QlikViewData\Export2.xls"
'Create the Excel spreadsheet
Set excelFile = CreateObject("Excel.Application")
excelFile.Visible = true
'Create the WorkBook
Set curWorkBook = excelFile.WorkBooks.Add
'Create the Sheet
Set curSheet = curWorkBook.WorkSheets(1)
'Get the chart we want to export
Set tableToExport = ActiveDocument.GetSheetObject("CH01")
Set chartProperties = tableToExport.GetProperties
tableToExport.CopyTableToClipboard true
'Get the caption
chartCaption = tableToExport.GetCaption.Name.v
'MsgBox chartCaption
'Set the first cell with the caption
curSheet.Range("A1") = chartCaption
'Paste the rest of the chart
curSheet.Paste curSheet.Range("A2")
excelFile.Visible = true
'Save the file and quit excel
curWorkBook.SaveAs filePath
curWorkBook.Close
excelFile.Quit
'Cleanup
Set curWorkBook = nothing
Set excelFile = nothing
End Sub
Макрос в Эксель