1. Excel formula doesn't work when put in from VBA, but works when written in Excel
2. Excel formula doesn't work when put in from VBA, but works when written in Excel
You can also look at the FormulaLocal option; it uses local separators and function names -- Kind regards, Niek Otten Microsoft MVP - Excel "Dave Peterson" < XXXX@XXXXX.COM > wrote in message news: XXXX@XXXXX.COM ... | Excel is USA centric. | | Try changing your semicolons (;) to commas (,). | | | | Frank_T_L wrote: | > | > I have made vba-code that makes a formula to be pasted into one cell at the | > time in Excel. | > | > The vba-code: | > vAktivCelle = "J" & i | > vFormel = "=if(E" & i & "=0;if(((G" & i & "+H" & i & | > ")*Parametre!$E$5" | > vFormel = vFormel & "+G" & i & "+H" & i & "+I" & i & ")-F" & i & | > "<0;0;" | > vFormel = vFormel & "(G" & i & "+H" & i & ")*Parametre!$E$5+G" & i & | > "+H" & i & "+I" & i & "-F" & i & ");" | > vFormel = vFormel & "if(G" & i & "+H" & i & "+I" & i & "-F" & i & | > "<0;0;" | > vFormel = vFormel & "if(E" & i & "=F" & i & ";0;G" & i & "+H" & i & | > "+I" & i & "-F" & i & ")))" | > ActiveSheet.Range(vAktivCelle).Formula = vFormel | > | > This generates this formula: | > =if(E2=0;if(((G2+H2)*Parametre!$E$5+G2+H2+I2)-F2<0;0;(G2+H2)*Parametre!$E$5+G2+H2+I2-F2);if(G2+H2+I2-F2<0;0;if(E2=F2;0;G2+H2+I2-F2))) | > | > When I run it - I get this error-message: | > Run-time error '1004' | > Application-defined or object-defines error | > | > ************** | > | > But: if I remove the first "=", and vba just puts the text into the cells - | > I can just go to the cell, write "=" in front of the text - and then IT | > WORKS....! | > | > Anyone got an idea about why it doesn't work when I put it in from vba? | > | > Frank | | -- | | Dave Peterson
3. Excel formula doesn't work when put in from vba, but the formula works in Excel
4. WScript.Shell works as .vbs file, doesn't work as .htm file
5. Working vbs program doesn't work anymore -HELP
6. excel work sheet control doesn't work
I draw a excel sheet control on my form,
Private Sub Command2_Click()
'
OLE1.Class = "Excel.Sheet.5"
OLE1.Action = 0 'OLE_CREATE_EMBED
'OLE1.Height = 4000
'OLE1.Width = 8000
'OLE1.Visible = True
'OLE1.Enabled = True
OLE1.Action = 7 'OLE_ACTIVATE
'OLE1.object.cells(1, 1).Value = "Jan"
'OLE1.object.cells(2, 1).Value = 3
'OLE1.object.cells(3, 1).Value = 4
'OLE1.object.cells(4, 1).Value = 6
End Sub
and try to use cell to set values, but the VB always give me error, sounds
no cell property under 'object' ?
what 's wrong ? the excel.sheet version not right ?
what I want in my code is just put a grid, and set value on each grid, or
are there any other ways I can implement this ?
thanks a lot for any input .
7. ActiveX-Exe: .Value=True doesn't work while direct click on button works - Visual Basic/VB
8. Run .bat as Scheduled Task doesn't work, but manual execute works
I have a vb script that is executed from a .bat file. When I fire off the .bat file manually it works fine. When I run it as a Scheduled Task using CMD.exe it almost finishes and then hangs. I'm using the same admin account for both scenarios. This is after a Windows Server 2003 upgrade. Any thoughts?