我在VBA Office2016 32位中创建了项目,现在我正在尝试在Office365 32位(WIN10)中运行这个项目,当然我有DataPicker的问题(已解决),但现在在运行代码期间,我有错误"Complie error: Can't find project or liberary“。问题是:
currentMonth = Month(Date)你知道为什么" date“不能显示今天的日期吗?在Excel 2016中没有问题。
发布于 2021-01-13 01:56:39
日期未在此处定义。它是在其他地方定义的吗?看起来日期被重新定义了。
这段代码也适用于早期版本:
Option Explicit
Sub test()
Dim theDate as Date
Dim currentMonth As Integer
theDate = Now()
currentMonth = Month(theDate)
Debug.Print currentMonth
End Subhttps://stackoverflow.com/questions/65688992
复制相似问题