aijoltnieland
New Member
- Joined
- Jul 3, 2018
- Messages
- 4
In my old win7 machine I used to transfer data from a CRM program to excel for calculation. This machine is replaced by a win 10 64 Bits machine and Office 365 64 bits. The CRM program is replaced by ACCESS 365 software.
Now the problem: when I transfer data from ACCESS to EXCEL using vba in ACCESS like here below
Private Sub BtnNaarCalc_Click()
Dim objXLApp As Object
Dim objXLBook As Object
Dim r As Object
Set objXLApp = CreateObject("Excel.Application")
Set objXLBook = objXLApp.Workbooks.Open("V:\Data\excel\calcgeg\Calculatie ACCESS 202008.xlsm")
objXLApp.Application.Visible = True
objXLBook.Sheets("Gegevens uit Act").Select
With objXLBook.Sheets("Gegevens uit Act")
.Cells(1, 1).Value = Forms!FrmOffNrs.OffNr.Value
.Cells(2, 1).Value = Forms!FrmOffNrs.OffAcqNr.Value
.Cells(3, 1).Value = Forms!FrmOffNrs.Form!SFrmOffvlgNrs!OffDatum.Value
.Cells(4, 1).Value = 0.25 'prijsnivo
.Cells(5, 1).Value = Forms!FrmOffNrs.OffAanvrager.Value
'some 30 more fields are transferred I left these to keep the question simple
End with
objXLApp.Application.Visible = True
objXLBook.Sheets("Optie 1").Select
Set objXLBook = Nothing
Set objXLApp = Nothing
End Sub
The problem is that the formulas in EXCEL are random supplyed by an @ sign
So =ALS(Kabelafstand_kast1>5;J14*(Kabelafstand_kast1+3);Lengte_hellingbaan1)
becomes =@ALS(@Kabelafstand_kast1>5;J14*(@Kabelafstand_kast1+3);Lengte_hellingbaan1)
resulting in an error #Name
How can I prevent these errors
Now the problem: when I transfer data from ACCESS to EXCEL using vba in ACCESS like here below
Private Sub BtnNaarCalc_Click()
Dim objXLApp As Object
Dim objXLBook As Object
Dim r As Object
Set objXLApp = CreateObject("Excel.Application")
Set objXLBook = objXLApp.Workbooks.Open("V:\Data\excel\calcgeg\Calculatie ACCESS 202008.xlsm")
objXLApp.Application.Visible = True
objXLBook.Sheets("Gegevens uit Act").Select
With objXLBook.Sheets("Gegevens uit Act")
.Cells(1, 1).Value = Forms!FrmOffNrs.OffNr.Value
.Cells(2, 1).Value = Forms!FrmOffNrs.OffAcqNr.Value
.Cells(3, 1).Value = Forms!FrmOffNrs.Form!SFrmOffvlgNrs!OffDatum.Value
.Cells(4, 1).Value = 0.25 'prijsnivo
.Cells(5, 1).Value = Forms!FrmOffNrs.OffAanvrager.Value
'some 30 more fields are transferred I left these to keep the question simple
End with
objXLApp.Application.Visible = True
objXLBook.Sheets("Optie 1").Select
Set objXLBook = Nothing
Set objXLApp = Nothing
End Sub
The problem is that the formulas in EXCEL are random supplyed by an @ sign
So =ALS(Kabelafstand_kast1>5;J14*(Kabelafstand_kast1+3);Lengte_hellingbaan1)
becomes =@ALS(@Kabelafstand_kast1>5;J14*(@Kabelafstand_kast1+3);Lengte_hellingbaan1)
resulting in an error #Name
How can I prevent these errors