Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command-line switches TJ Dowling Excel Discussion (Misc queries) 2 February 8th 08 04:00 PM
Command line switches - possible Niniel Excel Discussion (Misc queries) 0 August 17th 07 01:53 AM
Q: command line in OE JIM.H. Excel Discussion (Misc queries) 0 May 30th 05 10:48 PM
Sendkeys VBA and command line Bobsa Excel Programming 1 April 15th 04 10:12 AM
DOS Command Line Chris Excel Programming 5 October 2nd 03 02:06 PM


All times are GMT +1. The time now is 11:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"