返回列表 上一主題 發帖

[發問] 別台開啟VBA後,點控制按鈕卻沒反應(已經爬過很多很多文...)

[發問] 別台開啟VBA後,點控制按鈕卻沒反應(已經爬過很多很多文...)

大家好,因小妹是VBA幼幼班,好不容易寫完一個VBA,拿到其他同事電腦用。發現別台電腦點工作表1的command button,本來要跳出來的UserForm卻沒出現,而同一個檔案我自己試是正常沒問題的。
我公司統一是WIN7 + OFFICE2010,試了好幾個同事的電腦,一律沒反應。
爬過很多類似這種情況的文,卻毫無頭緒。請各位大俠和女俠救救我~檔案請參考附件>"< TEST.rar (102.12 KB)

我同時開2台電腦測試,結果如下:

1. 在CommandButton失效的電腦,略過在工作表1點CommandButton會彈出UserForm的動作,直接試跑後面的程式,結果都好好的沒問題。

2. 然後又試著執行"UserForm中設計的CommandButton",結果也OK沒問題。

3. 在CommandButton失效的電腦,執行工作表1的3個程式(如下圖)都失敗

如果執行這3個程式,都會出現錯誤訊息


4. 我在我電腦中隨便開新的EXCEL,寫一個
  1. Private Sub CommandButton1_Click()
  2.     UserForm2.Show
  3. End Sub
複製代碼
在其他電腦仍舊沒反應

請問如何解決?

謝謝兩位的回覆,我用#2的方式測試了4台電腦,把電腦更新到最新後,至https://support.microsoft.com/kb/3025036/zh-tw 下載microsoft fix,有2台成功可以用activeX控制項,有2台依然沒反應。

剛才再參考#3大大提供的文章,發現失敗的電腦都有一個共通點。
當我開啟包括ActiveX的Excel後,測試發現不成功後。無論有否更改Excel任何內容,只要我存檔後重開檔案,都會出現下圖畫面。


請問是發生什麼事呢?

TOP

回復 3# clietj37

大大你好,剛才已經看過你的提供的解決方式。因為有些電腦仍然不成功。所以我參考文章中的Additional Step

Additional step:

If the steps above do not resolve your issue, another step that can be tested (see warning below):

On a fully updated machine and after removing the .exd files, open the file in Excel with edit permissions.

Open Visual Basic for Applications > modify the project by adding a comment or edit of some kind to any code module > Debug > Compile VBAProject.

Save and reopen the file. Test for resolution. If resolved, provide this updated project to additional users.

Warning: If this step resolves your issue, be aware that after deploying this updated project to the other users, these users will also need to have the updates applied on their systems and .exd files removed as well.


看得不是很懂"modify the project by adding a comment or edit of some kind to any code module > Debug > Compile VBAProject."是要做什麼? 是隨便編輯VBA中任何內容嗎? Debug 跟 Compile VBAProject 每個字都知道意思,但加起來就不知道實際要進行什麼動作...?{:3_60:}

但我隨便編輯一下後重開檔案就出現我在#4描述的情況。求大神解惑~~

TOP

        靜思自在 : 【蒙蔽的自由】人常在什麼都可以自由自在的時候,卻被這種隨心所欲的自由蒙蔽,虛擲時光而毫無覺知。
返回列表 上一主題