I am doing a database application in Access which entails having to transfer a lot of information, including formulas from Access to Excel.
I envision I will be running into a lot of problems, but here is one I can't figure out. The portion of code below shows where the problem develops.
I am looping through a table and transferring the values from the "formula" field into cells. The "formula" field in the Access table is defined as text. When I run the code everything works just fine...the workbook opens and transfers the information blah blah...
BUT, for some reason the formulas are visible in the cell. Only when I place the cursor in the cell and hit the enter keys does it actually calculate the formula. Now this is weird, because it tells me that the formula is correct, but for some reason it is as the cells are waiting for something before actually calculating the formulas.
I tried replacing the MySet!Formula reference with the actual string for the formula so that the code line would read the following instead:
.Cells(CurrRow, 2).Value = "Utilities*3"
And it WORKED, the formula was transferred and calculated automatically...Beats ME!
I even tried setting MySet!Formula to a declared string variable and use the string variable instead, but it still didn't work.
Any help would be appreciated.
Do Until MySet.EOF
With MainWkSh
.Rows(CurrRow).Insert
.Cells(CurrRow, 1).Value = MySet!ProcessDataName
.Cells(CurrRow, 1).Name = MySet!ProcessDataName
.Cells(CurrRow, 1).Font.Italic = True
.Cells(CurrRow, 1).Font.Bold = False
.Cells(CurrRow, 2).Value = MySet!Formula
End With
'-- Move to next record
MySet.MoveNext
'-- Increment Row
CurrRow = CurrRow + 1
Loop
I envision I will be running into a lot of problems, but here is one I can't figure out. The portion of code below shows where the problem develops.
I am looping through a table and transferring the values from the "formula" field into cells. The "formula" field in the Access table is defined as text. When I run the code everything works just fine...the workbook opens and transfers the information blah blah...
BUT, for some reason the formulas are visible in the cell. Only when I place the cursor in the cell and hit the enter keys does it actually calculate the formula. Now this is weird, because it tells me that the formula is correct, but for some reason it is as the cells are waiting for something before actually calculating the formulas.
I tried replacing the MySet!Formula reference with the actual string for the formula so that the code line would read the following instead:
.Cells(CurrRow, 2).Value = "Utilities*3"
And it WORKED, the formula was transferred and calculated automatically...Beats ME!
I even tried setting MySet!Formula to a declared string variable and use the string variable instead, but it still didn't work.
Any help would be appreciated.
Do Until MySet.EOF
With MainWkSh
.Rows(CurrRow).Insert
.Cells(CurrRow, 1).Value = MySet!ProcessDataName
.Cells(CurrRow, 1).Name = MySet!ProcessDataName
.Cells(CurrRow, 1).Font.Italic = True
.Cells(CurrRow, 1).Font.Bold = False
.Cells(CurrRow, 2).Value = MySet!Formula
End With
'-- Move to next record
MySet.MoveNext
'-- Increment Row
CurrRow = CurrRow + 1
Loop