|
发表于 2014-5-8 08:34
|
显示全部楼层
本楼为最佳答案
本帖最后由 hwc2ycy 于 2014-5-8 08:37 编辑
- Sub 权限() '问题代码
- Application.DisplayAlerts = False
- Dim cnn As New ADODB.Connection
- Dim rst As New ADODB.Recordset
- Dim pthStr, SQL As String
- Dim Jcount, a As Integer
- 'pthStr = ThisWorkbook.Path & "\mg.mdb"
- Stpath = "1.mdb"
- cnn.Open "Provider=Microsoft.Jet.Oledb.4.0;data Source=" & ThisWorkbook.Path & "" & Stpath
- SQL = "select * from yftab where name='" & Sheet1.Range("B6").Value & "'"
- rst.Open SQL, cnn, adOpenKeyset, adLockOptimistic
- If rst.EOF = False Then
- If rst.Fields("权限更新").Value < 1 Then
- Sheet2.Shapes("圆角矩形 1").Visible = True
- End If
- If rst.Fields("权限更新").Value > 0 Then
- Sheet2.Shapes("圆角矩形 1").Visible = False
- End If
- rst.MoveNext
- End If
- rst.Close
- cnn.Close
- Set rst = Nothing
- Set cnn = Nothing
- Application.DisplayAlerts = True
- End Sub
复制代码 形状没隐藏应该是你保护了工作表。 |
|