Free Microsoft Excel 2013
Quick Reference
Free Microsoft 2013 Quick Reference Guide

Free Microsoft Excel 2013 Quick Reference

VBA-Howto: Resize the Excel Window

Hello,

For one of my Excel workbook, I would like to resize automatically with a VBA macro the size of the Excel Window. The purpose is to get hardcopies with a standard size to paste in a ppt presentation.

Thanks for you suggestions.


Post your answer or comment

comments powered by Disqus
hi all

i need vba code to prevent resizing the excel window not the active sheet window .

thak you

Interrupting long calculations in Excel?

Hi all,

I am having a very long calculation in Excel using VBA.

Of course I know I can hit ESC or CTRL+BREAK to interrupt the VBA
program.

But I found due to too long running process, the Excel window stop to
respond for very long time,

besically it's like "not responding" situation with "not responding"
on the windows title bar...

It doesn't seem to accept any more key strokes, not to say ESC or CTRL
+BREAK.

What can I do to rein/stop my program?

Thanks

I have several numbers highlighted in Excel. When I look to the lower right
hand section of the Excel Window, I can see the sum of those numbers. If I
right click the sum, I can change to the maximum, the minimum, the average
and so forth. There are times it would be useful to capture the sum and be
able to copy the answer into a cell. I used to know how to do this but can
not remember now for the life of me. It doesn't wrk to ctrl+c and you can't
right click. Can anyone enlighten me? Thanks in advance.

Hi,

I am running a macro which process about 500 excel files from a folder, the code is running fine. However, the excel window is frozen when the macro is running, I could not select some shortcut on my desktop on the part where the excel window is on top of it.

May you show me how to minimize the Excel window while the Macro is running ? And if it is possible, popup window showing progress bar on how many percent it is processed based on the number of file processed vs number of total files, and also display the name of the file currently processed below it.

Thanks. I really appreciate your help.

Regards,
Thang Nguyen

When I use VBA to save and close a workbook it leaves the main excel window open - would it be possible to use vba to check if any other workbooks were open and then close the Excel window to "Tidy up"???

I can move and re-size the Excel window using the mouse. Is there an
Application.something_or_other that will allow me to do this with VBA?
--
Gary''s Student

I don't see any scroll bars on the 2007 Excel window... how can I get these
to appear so I can scroll down to the bottom of a workbook to see the sheets,
etc
?

I maintain some fairly hefty excel spreadsheets for a financial services
firm. The sheets have plugins to real time stock prices via a DDE feed
from a firm called Bloomberg. There are a number of macros that pull
data via queries from an MS SQL Server database. There are also a
number of different pivot tables that display all the data that comes
in.

Here is the problem: some users will randomly experience a gray bar
that takes up the left third of the excel window. This affects any
other spreadsheets that open up in that session of excel. You can
actually slide the windows in that session under or away from this gray
bar. The gray bar is not resizable, and the only way to get rid of it is
to completely kill the excel session.

The problem is usually triggered after a user hits a button that runs
code that executes the query to MS SQL Server, and then some other
cleaning and formatting of cells. Users may go weeks without seeing it
before they get it again. Some users experience it, others don't.

For the most part, the users are on Windows 2000 Professional and Excel
2000. Others are on 2003.

Any help would be greatly appreciated.

--
tgavin
------------------------------------------------------------------------
tgavin's Profile: http://www.excelforum.com/member.php...o&userid=25318
View this thread: http://www.excelforum.com/showthread...hreadid=387982

Dear experts,
I have a workbook on a server which many users can input, not shared though.
In opening it today I found out that the workbook window is very small, less
than half of the full size. I can't resize it, I can't move it, it seems to
be blocked in that position. The rezising arrows simply do not appear, and
so the resizing buttons.

I need to work with this workbook, can you please help me?
Many thanks in advance!
Best regards,

--
Valeria

I have a file in Excel called Job Cost Notes. When using quick keys, I
accidentally excecuted the New Window command in the Window menu. I now have
two Job Cost Notes open titled, Job Cost Notes:1 and Job Cost Notes:2

How do I reverse this command to revert to just a single file being open?

At the very top of the Excel window where you have the Microsoft Excel icon,
it contains the words 'Microsoft Excel - filename'. Until yesterday it was
showing the words 'Microsoft Excel - ' with the filename. Yesterday it
contained the '.xls' at the end of the filename and today it only contains
the filename with no file extension. I have an automated program that looks
for the filename with the file extsnsion to close down excel and it's not
working.

How do you control the display of the file extension or not?

I maintain some fairly hefty excel spreadsheets for a financial services firm. The sheets have plugins to real time stock prices via a DDE feed from a firm called Bloomberg. There are a number of macros that pull data via queries from an MS SQL Server database. There are also a number of different pivot tables that display all the data that comes in.

Here is the problem: some users will randomly experience a gray bar that takes up the left third of the excel window. This affects any other spreadsheets that open up in that session of excel. You can actually slide the windows in that session under or away from this gray bar. The gray bar is not resizable, and the only way to get rid of it is to completely kill the excel session.

The problem is usually triggered after a user hits a button that runs code that executes the query to MS SQL Server, and then some other cleaning and formatting of cells. Users may go weeks without seeing it before they get it again. Some users experience it, others don't.

For the most part, the users are on Windows 2000 Professional and Excel 2000. Others are on 2003.

Any help would be greatly appreciated.

I have this code that sets the workbook's size...

	VB:
	
Application.WindowState = xlNormal 
Application.Width = 750 
Application.Height = 620 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
...now I need help on a code that will position the excel window on the center of the screen
no matter what size/resolution the user have.

Please help! Thanks in advance

When a user click on a certain cell in my workbook, I show a form right next to the cell. The form is not shown modal, so the user can continue moving around the spreadsheet. As soon as the form is shown, it receives focus. Is there a way to return focus to the Excel window? That way to user can continue to move between cells with the arrow keys. Right now, when the form appears, the user would have to manually move their mouse over to the excel window and click.

I recently upgraded to Office 2007, including Excel. In the "olden days"
using Excel 2003, if you "highlighted" a group of numeric values, a total
used to show at the VERY bottom of the excel window (is this the status bar)?

I work on very large spreadsheets, and often want to do a quick checksum on
a group of related numeric values, just to see if they were input correctly,
and I have used this function extensively to do that.

Is there a way to turn this on in excel 2007?

Thanks!

Patk

Hi,

Well, the thing is that I am having a small problem with a COM Addin
that I created for Excel. I have used plain C++ . No MFC, No ATL, No
Libraries at all except for the Win API. The code base that I started
with is in

http://support.microsoft.com/default...;EN-US;Q230689

I have used exactly the same code with the IDTEXTENSIBILITY2 Interface
and stuff. The addin is workign fine, but I recently noticed something
was amiss. When the toolbar is showing, and we resize the excel window,
such that the controls on the toolbar go to the "down arrow" on the
left hand side of the toolbar, the buttons simply do not fire. I mean
the buttons on the toolbar do fire, but those buttons that are hidden
in the "Down Arrow" do not fire at all. Can you explain why this
happens? Also, I tried creating a toolbar using VBA and the above
problem does not arise when the toolbar and buttons are created through
VBA.

Can anyone help me?

Have you tried:

Application.Visible = False
....
shape.OLEFormat.Verb(Excel.XlOLEVerb.xlVerbOpen)
....
Application.Visible = True

--
Bob Kilmer

"Yi" > wrote in message
...
> I have a VB application that processes an Excel file. The
> Excel file has a Chart (actually a Workbook) Shape object
> embedded in it. The application needs to activate the
> Shape object in order to update the data in the worksheet.
> When the following code is called, the Excel window will
> always popup.
> shape.OLEFormat.Verb(Excel.XlOLEVerb.xlVerbOpen)
>
> Can anybody tell me how to hide the Excel window when this
> code is called? I can only find two types of verbs - Open
> and Primary, and they both display the window.
>
> Or, is there any other way to activate the OLE object
> without displaying the Excel window?
>
> Thanks in advance.
> Yi

Problem: when I doubleclick on an Excel file, the Excel window is opened, but
the file is not. I have to open it by File > Open and search for the file
every time.

Any ideas on how to solve this problem? My version: Excel 2003

Many thanks in advance,
Silvy.

PS No problem with Word, Access, Powerpoint though...

Hello again,

I was wondering if anyone knows how to pass control back to Excel after
the macro opens another application. What I have is a macro that opens
an Emulator window, then I have a UserForm that prompts the user to
enter their UserName. The problem is that the Emulator window is in
front of Excel at that point and you cannot see the UserForm behind it.
All it does it "flashes" the Excel window control in the TaskBar. Of
course, once you click on it, it then brings Excel up to the top of the
Z-Index/Level.

What I'm wondering is if there's a way to program part of the macro to
maybe "focus" back on the Excel application/workbook/worksheet AFTER
the Emulator application is opened. Reason why, is some users (believe
it or not) are just not smart enough to click on something they see
flashing at the bottom of the screen. They'll sit there and wait and
wait, calling me telling me it's not doing anything. When it fact it's
really waiting for them.

I just want to take this step out of the equation, so that I don't have
to worry about someone getting "hung up" at this point. Perhaps maybe
a BringWindowToTop() Function?

Thanks in advance!
Steve

Whenever I download any file from SAP, excel opens in small window.
Due to this I can not see my macro button on QAT. Hance I can not run
my macro without maximising the window.

Any keayboard shortcut available for maximising the excel window?

I know ctrl+F10 will maximise the file window of excel but I want
shortcut to maximise the excel application window.

Regards,
Madiya

Hi all,

I'm looking for the API Calls for the excel window to be hidden however I
still want the userforms to come up on the screen. If anybody can help me
that would be greatly appreciatly.

Jason

Hi,
I'm using C# application to open an Excel workbook by using
m_objExcel = new Excel.Application();
and it works fine but problem arises if user close Excel window and go
back to my C# application to open another excel workbook. the workbook
actually is opened successfully but Excel window is invisible now. User
have no choice to kill the EXCEL.EXE in task manager then only it can
resume as normal.

How do I get back the EXCEL window closed by user but still remain in
task manager?
I try to use ShowWindow(...) but it doesn't work.

Appreciate if anyone can help.

Regards,
Jessica

When I save my spreadsheet as a webpage and then I open that webpage, the
excel window comes up with big margins on each side.. is there anyway I can
expand this window? Thanks!

Hi all,

I found a bit of code that fits a certain number of columns to fit to the
excel window however my columns 'B' threw to 'E' and its only 'A' and 'F' is
meant to fit to to the rest of the window and my other difficulty is that the
zoom factor is not always 100, below is my first attempt if anyone can help
me on where I might be going wrong.

My Code

Setwidth = Worbooks("myWorkbook.xls").Sheets("Sheet1").Columns
_("B:B").Columnwidth
Setwidth = Setwidth + Worbooks("myWorkbook.xls").Sheets("Sheet1").Columns
_("C:C").Columnwidth
Setwidth = Setwidth + Worbooks("myWorkbook.xls").Sheets("Sheet1").Columns
_("D:D").Columnwidth
Setwidth = Setwidth + Worbooks("myWorkbook.xls").Sheets("Sheet1").Columns
_("E:E").Columnwidth
Totalwidth = ActiveWindow.Useablewidth
Factor = Worbooks("myWorkbook.xls").Sheets("Sheet1").Columns("B:B").width / _
Worbooks("myWorkbook.xls").Sheets("Sheet1").Columns("B:B").columnwidth _
WindowWidth = ((Totalwidth / Factor) * (((100 - ActiveWindow.Zoom) / 100) +
1)) - (Setwidth * (((100 - ActiveWindow.Zoom) / 100) + 1))
SideWidth = (WindowWidth) / 2
Workbooks("MyWorkbook.xls").Sheets("Sheet1").Columns("A:A").ColumnWidth = _
SideWidth
Workbooks("MyWorkbook.xls").Sheets("Sheet1").Columns("F:F").ColumnWidth = _
SideWidth

Thanks in Advance

Jason


No luck finding an answer? You could always try Google.