Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-10-09 12:13:48
Point:500 Replies:2 POST_ID:828375USER_ID:11059
Topic:
Microsoft Excel Spreadsheet Software;;Visual Basic Programming
it is hard to say my problem that is related to Virus or my VBA program.
After check with virus software there is no any issue.
I found the strange thing when I'm running my VBA program Subroutine
and set break point at some area by F9 to stop program at a breakpoint in advance
When VBA program is running and stop at the break pt, and then I
run explorer.exe to open other old excel file but I can't open it until i finish my subroutine
program or reset the VBA program completely . After complete the subroutine or reset program .
I mouse-click the old excel file in explorer folder that can be shown up within the same Excel application windows.
I never experience this before. Generally for debugging process, sometimes we always would like to stop VBA program
at breaking point set by F9 at the begining program start, and then open other new/old EXcel file that we are
always no any issue and easy task .
FOr my VBA program, I am doing a lot sending key and sleep like a.sendkey{"enter"} and Sleep(10),
now I suspect those code make a problem or lock the folder directory or ohter Excel file during debugging.
Is there any method to check the old Excel file statue before opening and unlock the file once it is locked
by (or during) other Excel VBA programming ?
Please advise
Duncan
After check with virus software there is no any issue.
I found the strange thing when I'm running my VBA program Subroutine
and set break point at some area by F9 to stop program at a breakpoint in advance
When VBA program is running and stop at the break pt, and then I
run explorer.exe to open other old excel file but I can't open it until i finish my subroutine
program or reset the VBA program completely . After complete the subroutine or reset program .
I mouse-click the old excel file in explorer folder that can be shown up within the same Excel application windows.
I never experience this before. Generally for debugging process, sometimes we always would like to stop VBA program
at breaking point set by F9 at the begining program start, and then open other new/old EXcel file that we are
always no any issue and easy task .
FOr my VBA program, I am doing a lot sending key and sleep like a.sendkey{"enter"} and Sleep(10),
now I suspect those code make a problem or lock the folder directory or ohter Excel file during debugging.
Is there any method to check the old Excel file statue before opening and unlock the file once it is locked
by (or during) other Excel VBA programming ?
Please advise
Duncan
VBA program:Sub DebuggingVBA()Dim a, WScript As ObjectDim waitcont As Integerwaitcont = 5Set a = CreateObject("WScript.shell")a.sendkeys {"enter"}sleep(1000);' Set a breakpoint by F9 before here and then go to open other new/old Excel'file from explorer.exe folder if program is stopped at this breaking pt' but the new/old excel file can't be opened till going to "ENDSub" statement"DOeventsa.sendkeys {"enter"}End Sub ' WHen the VBA program is coming at this pt by F8 and finished the sub or reset the program , I am able to open the other new/old Excel file.... 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:
Author: duncanb7 replied at 2024-10-10 07:11:52
It is fixed anyway
Accepted Solution
Expert: thydzik replied at 2024-10-10 05:48:45
500 points AVERAGE
this is normal VBA behaviour.
what exactly are you trying to program in that you need a subroutine running while opening a second workbook?
if you need to get data out of this second workbook, then add the opening into the code in the first workbook.