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

Related Questions

I have the this code that will create excel file and work sheet then
I have an open workbook that has a bunch of macros in it, one
I have an excel file that has a column that contains a number of
I have an excel file that has conditional formating set up to put a
I have an Excel file that has some Spanish characters (tildes, etc.) that I
I have an excel file that has ~10 columns and 1-20 rows. I need
I have a excel file that has a CDFSDDRCxxxCurryymmdd.xls(x) where xxx is a number
I have an Excel file that has columns A and B, both have data
My code is: Sub zaa() 'code to find another open file that has the
I have an Excel workbook that has a macro (the only macro in the

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.