VBA 실행 시 엑셀이 꺼지는 이유 + 해결 방법 (실제 사례 포함)

엑셀오류

VBA 실행 시 엑셀이 꺼지는 이유 + 해결 방법 (실제 사례 포함)

엑셀에서 VBA를 실행하다 보면 갑자기 엑셀이 꺼졌다가 다시 켜지거나, 전체 창이 멈추는 현상이 발생하는 경우가 있다.

특히 여러 개의 엑셀 파일을 동시에 열어놓고 자동화 코드를 돌릴 때 이 문제가 자주 발생한다.

나는 VBA를 돌리는 엑셀을 포함해서 4~5개의 엑셀을 동시에 열고 재고 확인 후 자동으로 닫는 VBA를 사용하고 있었는데 이 과정에서 전체 엑셀이 꺼지는 문제가 발생했다.

이 글에서는 실제로 많이 발생하는 원인과 바로 적용 가능한 해결 방법을 정리했다.

 

엑셀오류
<엑셀오류>

1. 이런 증상이 나오면 해당 문제다

아래와 같은 현상이 있다면 동일한 문제다.

  • VBA 실행 중 엑셀이 갑자기 종료됨
  • 여러 개 엑셀 창이 동시에 꺼졌다가 다시 켜짐
  • (Ver1) 같은 이름으로 새 파일이 생성됨
  • 실행 도중 멈추거나 반응 없음

👉 이건 단순 오류가 아니라 “Application 충돌”이다


2. 왜 이런 문제가 발생하는가

핵심 원인은 3가지다.

① 여러 엑셀 인스턴스 충돌

엑셀을 여러 개 실행하면 내부적으로 Application 객체가 꼬일 수 있다.
특히 VBA에서 다른 파일을 열고 닫는 작업을 반복하면 충돌 확률이 올라간다.


② 파일 닫기 코드 문제

다음과 같은 코드가 있을 때 문제가 발생한다.

Workbooks("파일명.xlsx").Close

👉 이 코드가 현재 실행 중인 파일까지 닫으려고 하면
엑셀 전체가 같이 종료되는 현상이 발생할 수 있다.


③ 화면 갱신 / 이벤트 중첩

기본 상태에서는 VBA 실행 중에도
화면 갱신과 이벤트가 계속 발생한다.

👉 이게 누적되면 렉 + 튕김 발생


3. 가장 확실한 해결 방법

아래 3개는 무조건 적용하는 게 좋다.


✔ 해결 방법 1: 화면 갱신 끄기

Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False

👉 실행 전에 반드시 넣는다


✔ 해결 방법 2: 안전한 파일 열기 방식

Dim wb As Workbook
Set wb = Workbooks.Open("파일경로")

👉 직접 이름으로 접근하지 말고 객체로 잡는다


✔ 해결 방법 3: 파일 닫을 때 충돌 방지

wb.Close SaveChanges:=False
Set wb = Nothing

👉 핵심은
“현재 실행 파일(ThisWorkbook)은 절대 건드리지 않는 것”


4. 실제 안정화 코드 예제

아래 코드는 실무에서 가장 안정적으로 쓰는 구조다.

Sub Safe_Run()

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    Application.EnableEvents = False

    Dim wb As Workbook

    Set wb = Workbooks.Open("C:\테스트.xlsx")

    ' 작업 수행
    wb.Sheets(1).Range("A1").Value = "완료"

    wb.Close SaveChanges:=True
    Set wb = Nothing

    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    Application.EnableEvents = True

End Sub

5. 실제 현장 사례

실제로 여러 개의 엑셀을 동시에 열어놓고
재고 데이터를 확인 후 자동으로 닫는 VBA를 사용했을 때

👉 전체 엑셀이 꺼지는 문제가 발생했다

원인은

  • 현재 파일까지 닫으려는 코드
  • ScreenUpdating 미설정

이 두 가지였다

위 코드로 수정 후
👉 더 이상 튕김 없이 안정적으로 실행됨


6. 추가로 꼭 체크해야 할 것

  • 동일 파일을 중복으로 열지 않기
  • 경로 오류 방지
  • 네트워크 드라이브 사용 시 속도 고려

7. 핵심 요약

  • 엑셀 꺼짐 = 대부분 Application 충돌
  • ScreenUpdating / Events 설정은 필수
  • 파일은 객체로 열고 닫는다

👉 이 3가지만 지켜도 8~90%는 해결된다


마무리

엑셀 VBA는 강력하지만
구조를 잘못 잡으면 불안정해진다.

특히 자동화 작업에서는
“안정성 > 속도”가 훨씬 중요하다.

위 방법을 기준으로 구조를 잡으면
실무에서도 충분히 안정적으로 사용할 수 있다.

 

Hamdeok Beach Guide (Jeju): Best Time, Cafes, Parking & Hidden Spots

Hamdeok Beach

Hamdeok Beach Guide (Jeju): Best Time, Cafes, Parking & Hidden Spots

Hamdeok Beach in Jeju Island is often described as one of the most beautiful beaches in Korea.
But beyond its famous emerald water, there are a few key details that can completely change your experience.

This guide covers everything you actually need to know — from the best time to visit, to cafes, parking, and hidden viewpoints.

Hamdeok Beach





1. Why Hamdeok Beach Is So Popular

 

Hamdeok Beach stands out because of its unique color.

  • Emerald, crystal-clear water
  • Wide, soft white sand
  • Shallow depth, making it safe for swimming

Unlike many beaches, the water here stays calm, which makes it ideal for families and relaxed travelers.

2. Best Time to Visit Hamdeok Beach

Timing matters more than most people think.

👉 Best time: 3 PM – Sunset

  • Around 3–5 PM → water color becomes most vibrant
  • Sunset → perfect for photography

From experience, visiting in the late afternoon gives the best light and fewer crowds compared to midday.

3. Parking at Hamdeok Beach (Important)

Parking can be confusing if you visit for the first time.

  • Public parking lots are available near the beach
  • Some areas are free, but they fill up quickly
  • Street parking is possible but limited

👉 Tip:
Arrive before 2 PM or after 6 PM to avoid peak parking stress.

4. 4. Cafes & Food Near Hamdeok Beach

Hamdeok is not just about the beach — the food scene is strong.

Must-try local food:

  • Grilled mackerel
  • Abalone porridge
  • Jeju seafood noodles

Cafe experience:

  • Ocean-view cafes line the beach
  • Perfect for slow travel and relaxing breaks

👉 Sitting in a cafe facing the sea during sunset is one of the highlights here.

5. Hidden Spot: Seoubong Peak

Right next to the beach is Seoubong Peak, a small hill with a big reward.

  • Short and easy hike (20–30 minutes)
  • Panoramic view of the beach
  • Great for photography

👉 If you want the best view of Hamdeok Beach, this is the spot.

6. Pros and Cons

✔ Pros

  • Stunning water color and scenery
  • Family-friendly swimming conditions
  • Easy access to food and cafes
  • Perfect for slow travel

❌ Cons

  • Can get crowded in peak season
  • Limited nightlife
  • Parking can be tight

7. Who Should Visit

Hamdeok Beach is ideal for:

  • Travelers who enjoy slow, relaxed trips
  • Families with children
  • Photographers looking for scenic spots
  • Food lovers exploring local cuisine

8. Cafe Delmoondo: The Best Ocean View Spot in Hamdeok

Right in front of Hamdeok Beach, there is a famous spot called Cafe Delmoondo.

From here, the view of the ocean is truly exceptional —
the color of the water and the peaceful atmosphere can easily rival some of the most beautiful beach destinations around the world.

When I visited, what stood out the most wasn’t just the view, but the feeling of calm you get while sitting there with a cup of coffee.

Inside the cafe, there is a simple but powerful message:

“The place where you are now is somewhere in the world for someone else.”

It adds a reflective touch to the whole experience, making you slow down and appreciate the moment.

What makes this place special:

  • Direct ocean view right in front of Hamdeok Beach
  • Perfect spot to relax after swimming
  • Easy access between the beach and the cafe

👉 During summer, you can even go straight from the beach to the cafe, making it a perfect combination of swimming + coffee + relaxation.

If you are visiting Hamdeok Beach, this is not just a cafe —
it’s part of the experience.

9. Final Thoughts

Hamdeok Beach is more than just a pretty location —
it’s a place where you can slow down and actually enjoy the moment.

If you’re planning a trip to Jeju, this is one of the spots that’s worth doing right —
with the right timing, the right viewpoint, and a bit of local insight.