ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Signing VBA code within an Excel spreadsheet from VBA (https://www.excelbanter.com/excel-programming/308497-signing-vba-code-within-excel-spreadsheet-vba.html)

Martin Waller

Signing VBA code within an Excel spreadsheet from VBA
 
Hello,

I have a system where I dynamically create XLS files on the fly by
automating Excel 2003. The XLS files contain VBA code that is injected,
again via automation, and I'd like to know if it is possible to dynamically
sign the code too - again on the fly and not by the dialogs.

Any help would be much appreciated...

Martin



Bernie Deitrick

Signing VBA code within an Excel spreadsheet from VBA
 
Martin,

I believe that you need to use a template file that is already signed as the
basis of your files created on the fly.

HTH,
Bernie
MS Excel MVP

"Martin Waller" wrote in message
...
Hello,

I have a system where I dynamically create XLS files on the fly by
automating Excel 2003. The XLS files contain VBA code that is injected,
again via automation, and I'd like to know if it is possible to

dynamically
sign the code too - again on the fly and not by the dialogs.

Any help would be much appreciated...

Martin





Jeff Jones[_2_]

Signing VBA code within an Excel spreadsheet from VBA
 
Martin,

I'm sorry to bother you but it looks as if you've already got a
solution to something I'm trying to do in MS Excel. I saw the
following message on the microsoft.public.excel.programming list.


Using MS Access, I have some code that runs a query and then outputs
the rows in the result to am MS Excel spreadsheet. I then push a
button in MS Excel to launch a macro in my personal.xls file to
reformat the data. I add filters via the macro to the columns to
enable us to easily look at subsets of the data. I have a little
function that I'd like to add to the newly created spreadsheet so that
I can produce some totals based on visible cells. Here's the
function.

=Sum_Visible_Cells(A1:A5) ' where A1:A5 is the range that you want
to sum and is placed in a cell in the spreadsheet..


Function Sum_Visible_Cells(Cells_To_Sum As Object)
Application.Volatile
For Each cell In Cells_To_Sum
If cell.Rows.Hidden = False Then
If cell.Columns.Hidden = False Then
total = total + cell.Value
End If
End If
Next
Sum_Visible_Cells = total
End Function

Based on your question, it looks as if you have figured out how to
programmatically add code to a spreadsheet. if this is true, would
you object to sharing how you do it?

Thank you.

Best Regards,
Jeff Jones
EDS
5109 Deer Lake Trail
Wake Forest, NC 27587

n Tue, 31 Aug 2004 13:56:08 +0100, "Martin
Waller" wrote:

Hello,

I have a system where I dynamically create XLS files on the fly by
automating Excel 2003. The XLS files contain VBA code that is injected,
again via automation, and I'd like to know if it is possible to dynamically
sign the code too - again on the fly and not by the dialogs.

Any help would be much appreciated...

Martin



Bernie Deitrick

Signing VBA code within an Excel spreadsheet from VBA
 
Jeff,

If you are filtering your values, then simply use

=SUBTOTAL(9, A1:A5)

which will give the sum of all the visible (not hidden by the filter) cells.

HTH,
Bernie
MS Excel MVP

"Jeff Jones" wrote in message
...
Martin,

I'm sorry to bother you but it looks as if you've already got a
solution to something I'm trying to do in MS Excel. I saw the
following message on the microsoft.public.excel.programming list.


Using MS Access, I have some code that runs a query and then outputs
the rows in the result to am MS Excel spreadsheet. I then push a
button in MS Excel to launch a macro in my personal.xls file to
reformat the data. I add filters via the macro to the columns to
enable us to easily look at subsets of the data. I have a little
function that I'd like to add to the newly created spreadsheet so that
I can produce some totals based on visible cells. Here's the
function.

=Sum_Visible_Cells(A1:A5) ' where A1:A5 is the range that you want
to sum and is placed in a cell in the spreadsheet..


Function Sum_Visible_Cells(Cells_To_Sum As Object)
Application.Volatile
For Each cell In Cells_To_Sum
If cell.Rows.Hidden = False Then
If cell.Columns.Hidden = False Then
total = total + cell.Value
End If
End If
Next
Sum_Visible_Cells = total
End Function

Based on your question, it looks as if you have figured out how to
programmatically add code to a spreadsheet. if this is true, would
you object to sharing how you do it?

Thank you.

Best Regards,
Jeff Jones
EDS
5109 Deer Lake Trail
Wake Forest, NC 27587

n Tue, 31 Aug 2004 13:56:08 +0100, "Martin
Waller" wrote:

Hello,

I have a system where I dynamically create XLS files on the fly by
automating Excel 2003. The XLS files contain VBA code that is injected,
again via automation, and I'd like to know if it is possible to

dynamically
sign the code too - again on the fly and not by the dialogs.

Any help would be much appreciated...

Martin






All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com