Good day.
Current scenario:
*1. Database.*
I have a spreadsheet (Sheet 1) containing the information
*2. Template (quote form).*
There is a form, with a specific layout that uses:
a- Validity > Cell Range > First Column from Sheet 1
b- For the fields (date, description, etc.) the function
=IFERROR(VLOOKUP($B$4,'Sheet1'.A2:E89,*5*,0),0) is inserted (FYI the *5*
changes depending on the column required from Sheet 1-- date is 5)
*3. PDF Export Macro.*
The following macro (inserted in an action button) is used to export to PDF:
/sub ExportPDF
Dim oDescriptor
rem define variables
dim document as object
dim dispatcher as object
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oSheets = ThisComponent.getSheets()
oSheet3 = oSheets.getByIndex(2)
rem name of the file
filename = oSheet1.getCellRangeByName("B4").getString()
rem ----------------------------------------------------------------------
rem Prepare for PDF export
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "URL"
args1(0).Value = "file:///C:/Users/rb/Desktop/Special%20Project/Joe%20Doe/"&
oSheet3.getCellRangeByName("B4").getString()&".pdf"
args1(1).Name = "FilterName"
args1(1).Value = "calc_pdf_Export"
dispatcher.executeDispatch(document, ".uno:ExportDirectToPDF", "", 0,
args1())/
end sub
Everything working great here: the quote is exported to PDF using the name
of cell B4, which is the cell containing the cell range from Sheet 1. Every
time I click on the drop-down box (validity) the information (date, etc.)
changes based on Sheet 1.
*Question:*
Is it possible to create a macro that exports simultaneously all of the
quotes (in PDF) according to the validity cell range?
By doing this, I wouldn´t have to click on the drop-down box each time I
want to get the next set of information.
*The desired result would be that with one single click on the "push
button", 88 PDF files would be exported (with the correspondent information
and file names)