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 88749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:36:32+00:00 2026-05-10T22:36:32+00:00

I have an Excel file that has a bunch of VBA and macro code

  • 0

I have an Excel file that has a bunch of VBA and macro code in it. When I open the file in Excel I can choose not to ‘enable’ them – so the values in the fields all stay as they were during the last save. I need to manipulate the values as they were last saved – so I don’t want the macros (which look at the current date and update values accordingly) to run.

When I open it via our dot net code:

Dim oxlRep As Excel.Application Dim oWBRep As Excel.Workbook Dim oSheetRep As Excel.Worksheet Dim oRngRep As Excel.Range oxlRep.Open(path) 

the vb code runs – throwing off the values. I’ve been looking for a way to open it without macros, or in ‘secure’ mode where the macros aren’t run. If I simply double click the file and don’t choose to enable macros the values are all there as I want them.

Usually we run this code within the month that the files are created, so we haven’t seen this problem in the 3 or 4 years that it has been working. Now I need to go back to some of the old files and run some archival code…

Anyone have a suggestion?

  • 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. 2026-05-10T22:36:32+00:00Added an answer on May 10, 2026 at 10:36 pm
    Application.AutomationSecurity = msoAutomationSecurity.msoAutomationSecurityForceDisable 

    Try opening the workbook after this statement. I think, this will disable macros at Application Level (not at workbook level)

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 123k
  • Answers 123k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For .mo file support, check out the gettext functions, and… May 12, 2026 at 1:01 am
  • Editorial Team
    Editorial Team added an answer Additionally, you should look at the error info. Part of… May 12, 2026 at 1:01 am
  • Editorial Team
    Editorial Team added an answer Your code works as is. It is just that your… May 12, 2026 at 1:01 am

Related Questions

I have a multilanguage website and need automate the process of updating textlayers in
I have an access 2007 Database that outputs a report in excel format, the
I have a query that has approximately 20 columns and I would like to
I have an excel document represented as a byte[] and I'm wanting to send

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.