P
PayeDoc
Hello All
I need to output the results of a query as an excel file (which then needs
to be emailed) - but the excel file must be password-protected. So far I'm
doing this fairly manually but I really do need to automate it. Obviously
saving the data to a spreasheet is simple enough, but I have been unable to
find a way of using code to save the spreadsheet with a password, so I'm now
looking at using macro actions TransferText or TransferSpreadsheet, but
still can't get it working.
The good news is that the password will always be the same (!) so could be
hard-coded, and there will always be just one record, and a fixed number of
fields (21 of them) and fixed field names, so the spreadsheet will always
have the same column headers and then just one data row. I have created a
'template' spreadsheet with the password set, and was hoping to be able to
'transfer' the query results into it, but either the whole dataset ends up
in cell A1, or I get one of a number of not-very-helpful messages (e.g.
"Could not decrypt file").
I've probably made heavy weather of this, but if someone could help me along
that would be great!!
Many thanks
Leslie Isaacs
I need to output the results of a query as an excel file (which then needs
to be emailed) - but the excel file must be password-protected. So far I'm
doing this fairly manually but I really do need to automate it. Obviously
saving the data to a spreasheet is simple enough, but I have been unable to
find a way of using code to save the spreadsheet with a password, so I'm now
looking at using macro actions TransferText or TransferSpreadsheet, but
still can't get it working.
The good news is that the password will always be the same (!) so could be
hard-coded, and there will always be just one record, and a fixed number of
fields (21 of them) and fixed field names, so the spreadsheet will always
have the same column headers and then just one data row. I have created a
'template' spreadsheet with the password set, and was hoping to be able to
'transfer' the query results into it, but either the whole dataset ends up
in cell A1, or I get one of a number of not-very-helpful messages (e.g.
"Could not decrypt file").
I've probably made heavy weather of this, but if someone could help me along
that would be great!!
Many thanks
Leslie Isaacs