M
MSCom
Neuer Benutzer
Threadstarter
- Dabei seit
- 20.09.2016
- Beiträge
- 1
Hello, I`m new in this community.
I`ve already searched on diverse HPs without finding a solution. I really hope, someone here can help me.
Using VBA in Excel I start a
connections(1).refresh
It is a PowerQuery that is loaded to a Worksheet(1) as table. The user should start the code after finishing his entries.
It is necessary to protect this sheet afterwards. I do it this way:
Sheets(1).protect Password:= pw
But this interrupts the download process. So my question is: How do I get to know whether the refreshing process has finished?
I`ve already tried some things with minor or no success:
.Protect Password:= pw, UserInterFaceOnly:=True
'or
Range("A1").QueryTable.Refresh BackgroundQuery:=False
'or
DoEvents
'or
Application.CalculateUntilAsyncQueriesDone
The refreshing process is interrupted every time since the protection step is applied, while refreshing is still ongoing.
This one works but is very "ugly" because I can`t know whether the procedure is used on a very slow PC:
Application.OnTime Now + TimeValue("00:00:15"), "Sheet_Protect_Sub"
Thanks
Jan_A
I`ve already searched on diverse HPs without finding a solution. I really hope, someone here can help me.
Using VBA in Excel I start a
connections(1).refresh
It is a PowerQuery that is loaded to a Worksheet(1) as table. The user should start the code after finishing his entries.
It is necessary to protect this sheet afterwards. I do it this way:
Sheets(1).protect Password:= pw
But this interrupts the download process. So my question is: How do I get to know whether the refreshing process has finished?
I`ve already tried some things with minor or no success:
.Protect Password:= pw, UserInterFaceOnly:=True
'or
Range("A1").QueryTable.Refresh BackgroundQuery:=False
'or
DoEvents
'or
Application.CalculateUntilAsyncQueriesDone
The refreshing process is interrupted every time since the protection step is applied, while refreshing is still ongoing.
This one works but is very "ugly" because I can`t know whether the procedure is used on a very slow PC:
Application.OnTime Now + TimeValue("00:00:15"), "Sheet_Protect_Sub"
Thanks
Jan_A