+ Reply to Thread
Results 1 to 2 of 2

VBA & Command Line

  1. #1
    Soze
    Guest

    VBA & Command Line

    I want to have Excel set up such that when I try to open a file that's
    greater than, say, 20 MB, I want the file to open with manual
    calculate, else to open normally with automatic calculation. Is there
    an easy way to achieve something like this? I tried adding a file to
    the XLSTART folder with a macro that checks for file size and according
    sets the manual calculation, but I can't get anything like that to work
    since I can't pass to this macro the name of the file that was opened
    in the first place...


  2. #2
    AA2e72E
    Guest

    RE: VBA & Command Line

    I don't think it is possible to pass arbitraty parameters on the command line.
    You might be able to control calculation in the Workbook+Open event; this
    will determine the size (in the filing system) of the workbook being opened:

    Sub aa()
    Set fsof =
    CreateObject("Scripting.FileSystemObject").GetFile(ActiveWorkbook.FullName)
    If fsof.Size > (20 * 1024) Then
    ' your code
    Else
    ' your code
    End If
    Set fsof = Nothing
    End Sub


    "Soze" wrote:

    > I want to have Excel set up such that when I try to open a file that's
    > greater than, say, 20 MB, I want the file to open with manual
    > calculate, else to open normally with automatic calculation. Is there
    > an easy way to achieve something like this? I tried adding a file to
    > the XLSTART folder with a macro that checks for file size and according
    > sets the manual calculation, but I can't get anything like that to work
    > since I can't pass to this macro the name of the file that was opened
    > in the first place...
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1