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
    ' 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

183 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:

  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:

  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

Leave a Reply

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