Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
798 views
in Technique[技术] by (71.8m points)

excel - Suddenly several VBA macro errors, mostly 32809

Suddenly my excel file is generating a lot of errors at startup.
No changes have been made to the file since before the errors started.

Example of errors:

Error 438:

Sheets("setup2").CheckBox4.Caption = "L?gg automatiskt till " & _ 
    Sheets("setup2").Range("L8").Value & " m?ndag efter jour."

Error 32809:

Worksheets(1).Visible = True
Worksheets(1).Cells(42, 3) = ActiveWorkbook.Path
Sheets("setup").Cells(43, 3) = Environ("UserName")
Worksheets(1).Cells(35, 13) = MostRecentDate

The workbook is not password protected.
It's Office 2013 (15.0.4659.1000) MSO (15.0.4659.1001)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Similar issue. Created an application to track welding procedures. My machine was running Windows 7 and Excel 2010. Anything I created, then distributed to other machines with different OS's or different Excel versions would have 32809 errors, usually associated with selecting a worksheet

Sheets("Data Entry").Select

This would trigger an Application or run time error 32809. I tried all of the fixes previously mentioned (delete all temp files, .exd files etc. No joy.

My solution ( may not work for you)

Opened the application on a machine that was Excel 2007. Added one comment line of code of no consequence into one of the macros

Sheets(sheetName).Select 
'comment of no consequence

and saved it. This caused a recompile. Closed and re-opened with Excel 2007 - all fixed.

If I add any code to these applications on my machine and then distribute, there is invariably an error when run, unless I get the application to recompile on the differing system. I sent the fixed version onto another machine running Excel 2007 and it worked fine.

Hope this makes sense and helps

Grant


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...