Excel Sheet to Maximize thru VBA code

Ashfaque

Search Beautiful Girls from your town for night
Local time
Today, 12:49
Joined
Sep 6, 2004
Messages
897
Hi,

I am exporting my data to Excel thru below codes.

.......
..........
............
Set objxl = New Excel.Application
objxl.Visible = True
Set objwkb = objxl.Workbooks.Open("D:\Rectification.xlsx")
Set objsht = objwkb.Worksheets("Sheet1")

objsht.Range("A1:I1").Merge
.......
........
...........

Every code line is being exceted properly. The only thing is when data is transfering to Excel, the Excel file is becoming minimized while I want it to be on screen MAXIMIZED.....

Can anyone suggest me.....?

Regards,
Ashfaque
 
Try putting the following into your code after making the workbook visible.
Code:
objxl.ActiveWindow.WindowState = xlMaximized
Also, I suggest you make the application visible after opening the workbook. so final code looks like:
Code:
Set objxl = New Excel.Application
Set objwkb = objxl.Workbooks.Open("D:\Rectification.xlsx")
Set objsht = objwkb.Worksheets("Sheet1")
objxl.Visible = True
objxl.ActiveWindow.WindowState = xlMaximized
objsht.Range("A1:I1").Merge
 
Thanks NickHa,

I will let you know once done.....

Regards,
Ashfaque
 
Thanks NickHa,

It worked...

Regards,
Ashfaque
 

Users who are viewing this thread

Back
Top Bottom