Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7697489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:01:31+00:00 2026-05-31T22:01:31+00:00

I have created a GUI that will setup the pivot table. For example, I

  • 0

I have created a GUI that will setup the pivot table.

For example, I click button1 it will run and setup the pivot table.

When I click button3, it will have a run time error 1004 because it does not have the value in the data. So is it possible to let VBA accept that error and show a prompt that that data is not available?

enter image description here

By the way, I’m using this

ActiveSheet.PivotTables("PivotTable1").PivotFields("Test").CurrentPage = "Data1"

to setup the pivot table.

There are 3 different variables; Data1, Data2, Data3. If Data3 is not available, it will show the error but I want to have a prompt to show that it is not available.. If you know how to do it, please share it with me! Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:01:33+00:00Added an answer on May 31, 2026 at 10:01 pm

    Yes. For that you need to do appropriate error handling. See this sample code.

    Sub Sample()
        On Error GoTo Whoa
    
        '<Your REST OF THE CODE>
    
    LetsContinue:
        Exit Sub
    Whoa:
        '~~> This gives the exact desription and the error number of the error
        MsgBox "Description     : " & Err.Description & vbNewLine & _
               "Error Number    : " & Err.Number
    
        '~~> This part resumes the code without breaking it :)
        Resume LetsContinue
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a Java beginner. I already created a simple GUI application that display will
I have created a fairly substantial Java GUI application with many form windows where
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a PHP-script to update a web server that is live inside
I have created a UserControl that has a ListView in it. The ListView is
We are developing a web app that will have a pretty complex user and
I've created an overlay that will popup whenever someone wants to upload a file
I have a simple Jython GUI that displays an XML file in a JTree.
I have created a powershell module (.psm1) file that includes a few other powershell
I have created a simple GUI engine which I plan to use in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.