modifica Foglio excel in VBA ACCESS
Riduci
Di più
- Messaggi: 141
- Ringraziamenti ricevuti 0
4 Anni 8 Mesi fa #676
da fabioM1
fabioM1 ha creato la discussione modifica Foglio excel in VBA ACCESS
esempio
Private Sub scheda_Click()
Dim sorgente As String
Dim destinazione As String
Dim xlApp As Object
Dim xlWB As Object
Dim xlWS As Object
sorgente = Application.CurrentProject.Path & "\ModelloR2.xlsx"
destinazione = Application.CurrentProject.Path & "\R2_" & Me.matricola1 & ".xlsx"
FileCopy sorgente, destinazione
Set xlApp = CreateObject("Excel.Application")
'Set xlWB = xlApp.Workbooks.Open(CurrentProject.Path & "\test.xlsx")
Set xlWB = xlApp.Workbooks.Open(destinazione)
Set xlWS = xlWB.Sheets(1)
xlWS.Cells(1, 1) = "TEST ONLY"
xlWB.Save
xlWB.Close
Set xlWS = Nothing
Set xlWB = Nothing
Set xlApp = Nothing
End Sub
Private Sub scheda_Click()
Dim sorgente As String
Dim destinazione As String
Dim xlApp As Object
Dim xlWB As Object
Dim xlWS As Object
sorgente = Application.CurrentProject.Path & "\ModelloR2.xlsx"
destinazione = Application.CurrentProject.Path & "\R2_" & Me.matricola1 & ".xlsx"
FileCopy sorgente, destinazione
Set xlApp = CreateObject("Excel.Application")
'Set xlWB = xlApp.Workbooks.Open(CurrentProject.Path & "\test.xlsx")
Set xlWB = xlApp.Workbooks.Open(destinazione)
Set xlWS = xlWB.Sheets(1)
xlWS.Cells(1, 1) = "TEST ONLY"
xlWB.Save
xlWB.Close
Set xlWS = Nothing
Set xlWB = Nothing
Set xlApp = Nothing
End Sub
Si prega Accedi a partecipare alla conversazione.
Tempo creazione pagina: 0.105 secondi
- Sei qui:
-
Home
-
Forum
-
MsAccess 2010 - Sharepoint 2010
- modifica Foglio excel in VBA ACCESS