Checking if another Worksheet is opened and its opening or closing

Sometime we have to call another Worksheet to get some data. Thanks to this code we could check if data source file is opened or closed.

In my case file couldn’t be open because a copy of file had to be created but under other name. When file was open during file copying an error occurred. Unfortunately I didn’t remember code source site.

Sub CheckOpen()

Dim Ret
Dim FolderPath As String

FolderPath = "Folder path where source files is located"

Ret = IsWorkBookOpen(FolderPath & "\FileName.xlsx")
If Ret = True Then
    ' Worksheet is opened - close without save changes
    Windows("FileName.xlsx").Close SaveChanges:=False
    Debug.Print "File has been closed" ' to be removed
Else
    ' Nothing happened - FileName.xlsx is closed
    Debug.Print "File is closed." ' to be removed
End If

' FileName.xlsx copying and create FileName2.xlsx
FileCopy FolderPath & "\FileName.xlsx", FolderPath & "\FileName2.xlsx"
    
' FileName2.xlsx opening 
Workbooks.Open FileName:=FolderPath & "\FileName2.xlsx"

End Sub

266 thoughts on “Checking if another Worksheet is opened and its opening or closing

  1. Pingback: trang web đánh lô đề uy tín

  2. Pingback: buy psychadelic pills blotter tab dmt lsd ayahuasca online overnight cheap

  3. Pingback: Pi News Wire

  4. Pingback: cach bat de kep

  5. Pingback: choi game poker

  6. Pingback: UNICC SHOP

  7. Pingback: the natural penguin (TNP)

  8. Pingback: asik qq

  9. Pingback: eatverts.com

  10. Pingback: order generic morphine without prescription online pharmacy cheap

  11. Pingback: immediate edge

  12. Pingback: mature sex dolls

  13. Pingback: Immediate Edge

  14. Pingback: bitcoin loophole review

  15. Pingback: https://blazingtraderapp.com

  16. Pingback: mơ thấy tiền đánh con gì

  17. Pingback: mơ thấy con cá đánh đề con gì

  18. Pingback: Bichon Frise Puppies

  19. Pingback: Teacup pomeranians for Sale

  20. Pingback: Buy guns online

  21. Pingback: vang la so may trong so de

  22. Pingback: Sex dolls for sale

  23. Pingback: Panzer Arms BP-12

  24. Pingback: mơ thấy bị bắn

  25. Pingback: mơ thấy người chết đuối danh con gi

  26. Pingback: con cóc số mấy

  27. Pingback: mơ thấy gặt lúa

  28. Pingback: mơ thấy vợ cũ

  29. Pingback: cung kim ngưu nữ hợp với cung nào

  30. Pingback: tính cách cung bảo bình nữ

  31. Pingback: con trai song ngư thích con gái như thế nào

  32. Pingback: giải mã giấc mơ thấy người yêu cũ

  33. Pingback: Quality Engineering Consulting services

  34. Pingback: mơ trả nợ đánh con gì

  35. Pingback: Gym workout music 2020

  36. Pingback: nằm mơ thấy đi chùa

  37. Pingback: tennis truc tuyen

  38. Pingback: tai game ban ca an xu crack

  39. Pingback: game danh bai online nhieu nguoi choi nhat

  40. Pingback: tai game dua ngua

  41. Pingback: mơ thấy chảy máu tay

  42. Pingback: mix estate 2021

  43. Pingback: mơ thấy bàn thờ tổ tiên

  44. Pingback: house music music

  45. Pingback: buy levitra online cheap

  46. Pingback: mơ thấy cơm trắng

  47. Pingback: mơ thấy chùa

  48. Pingback: mơ ăn chuối

  49. Pingback: bốc mộ thấy rắn

  50. Pingback: mơ rụng tóc đánh con gì

  51. Pingback: brazilian cialis

  52. Pingback: cialis et fertilite

  53. Pingback: sildenafil walgreens

  54. Pingback: cialis for sale

  55. Pingback: generic cialis canadian

  56. Pingback: buy cialis united kingdom

  57. Pingback: buy cialis drug

  58. Pingback: original cialis low price

  59. Pingback: cialis original for sale

  60. Pingback: how to get ciails without a doctor

  61. Pingback: where can u buy cialis

  62. Pingback: zpmvhlun

  63. Pingback: buy cialis online overnight

  64. Pingback: how much viagra can i take in 24 hours

  65. Pingback: viagra wanneer innemen

  66. Pingback: what dosage should zithromax be for sinus infection

  67. Pingback: cheapest procurement of sildenafil

  68. Pingback: cialis dosage 20mg

  69. Pingback: order viagra

  70. Pingback: can i buy cialis online

  71. Pingback: buy cialis united kingdom

  72. Pingback: cialis 20mg low price

  73. Pingback: viagra

  74. Pingback: cheap writing service

  75. Pingback: how to write a research design

  76. Pingback: essay writing my ideal teacher

  77. Pingback: help me wityh my essay online

  78. Pingback: ethics and social responsibility in business essay

  79. Pingback: sophia viagra bikini

  80. Pingback: can i buy cialis online

  81. Pingback: amoxicillin 500 mg pill

  82. Pingback: furosemide 20mg tablets cost

  83. Pingback: azithromycin 1000mg tablets

  84. Pingback: ivermectin 500mg

  85. Pingback: albuterol 2.5 mg

  86. Pingback: doxycycline for staph

  87. Pingback: prednisolone manufacturers

  88. Pingback: clomid days

  89. Pingback: priligy amazon

  90. Pingback: diflucan birth control

  91. Pingback: synthroid pill doses

  92. Pingback: before after propecia

  93. Pingback: neurontin webmd

  94. Pingback: metformin brand name

  95. Pingback: paxil generic names

  96. Pingback: plaquenil copay card

  97. Pingback: reliable online pharmacy cialis

  98. Pingback: sildenafil 20 mg online canada

  99. Pingback: viagra achat sildenafil

  100. Pingback: cialis 100mg for sale

  101. Pingback: viagra pill cheap

  102. Pingback: generic viagra 200

  103. Pingback: is amoxicillin

  104. Pingback: keflex vs amoxicillin

  105. Pingback: medication azithromycin

  106. Pingback: celebrex arrhythmia

  107. Pingback: instaflex vs celebrex

  108. Pingback: hybridization for carbons in keflex

  109. Pingback: how long should keflex be used for

  110. Pingback: duloxetine 60 mg

  111. Pingback: duloxetine withdrawal

  112. Pingback: vardenafil vs sildenafil citrate

  113. Pingback: cialis generic from india

  114. Pingback: best generic levitra

  115. Pingback: best metformin brand

  116. Pingback: buy generic cialis online with paypal

  117. Pingback: how to get real cialis online

  118. Pingback: sildenafil 20 mg mexico

  119. Pingback: ivy secrect viagra mix up

  120. Pingback: real cialis for sale

  121. Pingback: tadalafil generic mexico

  122. Pingback: cialis 500mg

  123. Pingback: canadian viagra

  124. Pingback: sildenafil 50 mg buy online india

  125. Pingback: buy levitra online south africa

  126. Pingback: snorting cialis australia

  127. Pingback: sildenafil price in mexico

  128. Pingback: viagra fuck australia

  129. Pingback: finasteride for hair loss

  130. Pingback: price for viagra 100mg

  131. Pingback: comprar sildenafilo 100 mg

  132. Pingback: sildenafil 50 mg buy online

  133. Pingback: sildenafil generic 50 mg

  134. Pingback: cheap cialis for sale

  135. Pingback: sildenafil citrate side effects

  136. Pingback: generic viagra reviews australia

  137. Pingback: cialis reviews reddit australia

  138. Pingback: buy generic cialis india

  139. Pingback: viagra acheter amazon

  140. Pingback: cialis cost in mexico

  141. Pingback: fastest delivery of generic cialis

  142. Pingback: male erection pills

  143. Pingback: online ed pills

  144. Pingback: best rated canadian pharmacy

  145. Pingback: buy cialis tadalafil uk

  146. Pingback: pill pharmacy

  147. Pingback: buy cheap cialis uk

  148. Pingback: cialis without presciption in usa

  149. Pingback: payday usa loans

  150. Pingback: levitra retinitis pigmentosa

  151. Pingback: Tinder Matches But No Messages

  152. Pingback: faxless payday loans davenport

  153. Pingback: how long does viagra stay in your system

  154. Pingback: 20mg low price

  155. Pingback: zestril generic

  156. Pingback: free online dating sites with no blockings

  157. Pingback: where can i buy cialis over the counter

  158. Pingback: buy ativan in canada

  159. Pingback: generic cialis express delivery

  160. Pingback: cialis patent expiration date us

  161. Pingback: canadian pharmacy without a prescription

  162. Pingback: product team cialis getting ready to market

  163. Pingback: buy cialis tadalafil uk

  164. Pingback: canadian pharmacy no scripts

  165. Pingback: cut cialis in half

  166. Pingback: contrave canadian pharmacy

  167. Pingback: buy cialis online europe

  168. Pingback: buy cialis rush

  169. Pingback: cialis 20mg low price

  170. Pingback: treatments for ed

  171. Pingback: canada cialis

  172. Pingback: valtrex 500 india

  173. Pingback: viagra wiki

  174. Pingback: new treatments for ed

  175. Pingback: purchasing cialis

  176. Pingback: sildenafil 100mg usa

  177. Pingback: cialis dapoxetine

  178. Pingback: real generic viagra

  179. Pingback: cialis strength

  180. Pingback: viagra sample

  181. Pingback: viagra without a doctor prescription

  182. Pingback: tadalafil dosage recommendations

  183. Pingback: canadian pharmacy viagra

  184. Pingback: cytotmeds.com

  185. Pingback: diclofenac generic

  186. Pingback: drugs to treat ed

  187. Pingback: prednisone 5 mg from mexico

  188. Pingback: hydroxychloroquine cost without insurance

  189. Pingback: ivermectin generic name

  190. Pingback: dapoxetine 30 mg tablet price in india

  191. Pingback: free dating men

  192. Pingback: cialis with dapoxetine

  193. Pingback: buy stromectol canada

  194. Pingback: aciclovir

  195. Pingback: plaquenil hydroxychloroquine

  196. Pingback: ivermectin tablets uk

  197. Pingback: ivermectin 3

  198. Pingback: hydroxychloroquine use in florida

  199. Pingback: erection pills online

  200. Pingback: hydroxychloroquine acr pdf

  201. Pingback: canadian drug

  202. Thanks a lot for sharing this with all of us you really
    realize what you’re talking about! Bookmarked.
    Please additionally seek advice from my website =).
    We may have a hyperlink alternate arrangement between us

    click here=풀싸롱

  203. Pingback: when will viagra be generic

  204. Pingback: generic cialis canadian

  205. Pingback: buy cialis united kingdom

  206. Pingback: buy hydroxychloroquine over the counter

  207. Pingback: where to buy hydroxychloroquine over the counter

  208. Pingback: buy plaquenil uk

  209. Pingback: trump stops taking hydroxychloroquine

  210. Pingback: how much is cialis without insurance?

  211. Pingback: cialis and grapefruit enhance

  212. Pingback: how much does the military spend on viagra

  213. Pingback: viagra for sale overnight

  214. Pingback: pain meds online without doctor prescription

  215. Pingback: purchase zithromax z-pak

  216. Pingback: toronto pharmacy online

  217. Pingback: viagra how to use the first time

  218. Pingback: get viagra prescribed online

  219. Pingback: best canadian pharmacy reviews

  220. Pingback: https://regcialist.com

  221. Pingback: ivermectil with stromectol generic usa

  222. Pingback: stromectol drug

  223. Pingback: ed drugs over the counter

  224. Pingback: legal to buy prescription drugs from canada

  225. Pingback: ivermectin for skin infection

  226. Pingback: plaquenil depression

  227. Pingback: free cialis samples canada

  228. Pingback: mastercard generic cialis

  229. Pingback: bph dapoxetine

  230. Pingback: prednisone tablets

  231. Pingback: hcq 375

  232. Pingback: amlodipine besylate 2.5 mg tablet

  233. Pingback: atorvastatin calcium tablets.20mg

  234. Pingback: does prilosec cause constipation

  235. Pingback: prozac drug interactions

  236. Pingback: quetiapine side effects nhs

  237. Pingback: is escitalopram an anticholinergic

  238. Pingback: best canadian mail order pharmacies

  239. Pingback: cymbalta picture

  240. Pingback: buy viagra

  241. Pingback: hydrochlorothiazide cost walmart

  242. Pingback: ivermectin 250ml

  243. Pingback: ivermectin lotion

  244. Pingback: sildenafil 50 mg

  245. Pingback: can you just stop taking atorvastatin?

  246. Pingback: generic viagra online pharmacy

  247. Pingback: what is sertraline 100mg

  248. Pingback: https://viagratitan.com

  249. Pingback: buy sildenafil

  250. Pingback: drug medication

  251. Pingback: cialis tadalafil 10mg tablets

  252. Pingback: pharmacy medications

  253. Pingback: cialis official website

  254. Pingback: order generic cialis online

  255. Pingback: escitalopram para que se usa

  256. Pingback: tadalafil cialis 5mg

  257. Pingback: viagra online generic

  258. Pingback: ivermectin 6 price

  259. Pingback: buy generic viagra online

  260. Pingback: how old do you have to be to buy viagra

  261. Pingback: how fast does cymbalta work for pain

  262. Pingback: 1

  263. Pingback: viagra alternatives

  264. Pingback: where can i get cialis online

  265. Pingback: buy soft viagra

  266. Pingback: buy sildenafil online

Leave a Reply

Your email address will not be published. Required fields are marked *