Isn't access fun Lisa? Gawd, I can't stand using Access anymore except for fast prototyping. :)
My answer to your question is probably to use Automation. Unless you are trying to something very simple (like an append to the spreadsheet) you will want to use Automation (automation is the old terminology for it and I think they now refer to it as connecting to COM servers). Automation will allow you to open the spreadsheet and work with it directly. Using this method you can do full cell manipulation and it shoul give you what you want. The detail on automation is to large to post here but I have included a small example of creating a new spreadsheet from a Microsoft Press book.
Hopefully this will put you on the right track. Take care.
Private Sub mnuReportsInvoice_Click()
Static xl As Excel.Application
Set xl = New Excel.Application
With xl
.Visible = True
.Workbooks.Add
With .Range("A1")
.Value = "Chateau St. Mark Invoice"
.Font.Bold = True
.Font.Name = "Times New Roman"
.Font.Size = 26
End With
.Range("A4").Value = "Name:"
.Range("B4").Value = txtFirstName.Text & " " & txtLastName.Text
With .Range("A5")
.Value = "Address"
.VerticalAlignment = xlTop
End With
With .Range("B5")
.Value = txtAddress.Text
.ColumnWidth = 20
.WrapText = True
End With
.Range("A6").Value = "Number of Days:"
.Range("B6").Value = txtNumDays.Text
.Range("A7").Value = "Rate:"
.Range("B7").Value = txtRate.Text
.Range("A8").Value = "Total Due:"
.Range("B8").Value = Format(CSng(txtNumDays.Text) * CSng(txtRate.Text), "Currency")
'The rest
End With
Columns("A:A").ColumnWidth = 25
xl.ActiveWorkbook.PrintPreview
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement