vb6编程,引用excel单元格数据,异常。
代码如下:SetxlApp=CreateObject("Excel.Application")Setxlbook=xlApp.Workbooks.Open(Form2.T...
代码如下:
Set xlApp = CreateObject("Excel.Application")
Set xlbook = xlApp.Workbooks.Open(Form2.Text19.Text)
xlApp.Visible = False
Dim mjysg As Single
Dim mjysc As Single
mjysg = xlbook.worksheets(1).Cells(10, 7)
mjysc = xlbook.worksheets(1).Cells(42, 7)
jysg.Text = mjysg
jysc.Text = mjysc
xlbook.Close
Set xlApp = Nothing
其中xlbook.worksheets(1).Cells(10, 7)单元格数字为161231.22,在jysg.Text却显示为161231.20
xlbook.worksheets(1).Cells(42, 7)单元格数字为352988.45,在jysc.Text显示为352988.40,请帮助解决,谢谢!!! 展开
Set xlApp = CreateObject("Excel.Application")
Set xlbook = xlApp.Workbooks.Open(Form2.Text19.Text)
xlApp.Visible = False
Dim mjysg As Single
Dim mjysc As Single
mjysg = xlbook.worksheets(1).Cells(10, 7)
mjysc = xlbook.worksheets(1).Cells(42, 7)
jysg.Text = mjysg
jysc.Text = mjysc
xlbook.Close
Set xlApp = Nothing
其中xlbook.worksheets(1).Cells(10, 7)单元格数字为161231.22,在jysg.Text却显示为161231.20
xlbook.worksheets(1).Cells(42, 7)单元格数字为352988.45,在jysc.Text显示为352988.40,请帮助解决,谢谢!!! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询