C
Colleyville Alan
I have been working on an application that queries data from Access, loads
it into an array, and then writes it to an Excel spreadsheet. I use the
array approach to have fine control over spacing, formatting, etc. I have
gotten the first part of this to work by opening an Excel spreadsheet,
writhing the data, saving the spreadsheet and closing it. But what I would
like to do is to not actually open up Excel outside of Access. I want to
write the data to a spreadsheet embedded on the main form. I have tried
using an unbound frame with an embedded spreadsheet and I have tried simply
dropping an ActiveX spreadsheet on the form
However, when I open the form, while I can click on the spreadsheet and
manually enter data, I cannot figure out what VBA commands to use to grab
hold of the spreadsheet and write to the cells. For example, I currently
write to cells in the Excel spreadsheet that I open with the following code:
For iCtr = 1 To UBound(FundPerfArray)
oXLWKS.Range("B" & N) = FundPerfArray(iCtr).strFund_Name
oXLWKS.Range("C" & N) = FundPerfArray(iCtr).str_Category
oXLWKS.Range("D" & N) = FundPerfArray(iCtr).strTicker
...
Next iCtr
But while this works, I now want to do the same thing with the spreadsheet
that is embedded in the form so that the user has a preview of what the
final output will be and also will have the opportunity to modify it. But I
cannot seem to find how to access the Range property of the embedded
spreadsheet. The object inspector only shows properties such as boderstyle,
height, width, etc. Can't you use VBA to write to this embedded sheet as
opposed to only using it in an interactive fashion?
Thanks
it into an array, and then writes it to an Excel spreadsheet. I use the
array approach to have fine control over spacing, formatting, etc. I have
gotten the first part of this to work by opening an Excel spreadsheet,
writhing the data, saving the spreadsheet and closing it. But what I would
like to do is to not actually open up Excel outside of Access. I want to
write the data to a spreadsheet embedded on the main form. I have tried
using an unbound frame with an embedded spreadsheet and I have tried simply
dropping an ActiveX spreadsheet on the form
However, when I open the form, while I can click on the spreadsheet and
manually enter data, I cannot figure out what VBA commands to use to grab
hold of the spreadsheet and write to the cells. For example, I currently
write to cells in the Excel spreadsheet that I open with the following code:
For iCtr = 1 To UBound(FundPerfArray)
oXLWKS.Range("B" & N) = FundPerfArray(iCtr).strFund_Name
oXLWKS.Range("C" & N) = FundPerfArray(iCtr).str_Category
oXLWKS.Range("D" & N) = FundPerfArray(iCtr).strTicker
...
Next iCtr
But while this works, I now want to do the same thing with the spreadsheet
that is embedded in the form so that the user has a preview of what the
final output will be and also will have the opportunity to modify it. But I
cannot seem to find how to access the Range property of the embedded
spreadsheet. The object inspector only shows properties such as boderstyle,
height, width, etc. Can't you use VBA to write to this embedded sheet as
opposed to only using it in an interactive fashion?
Thanks