workbook Book1 missing on Exel start

R

RobH

Normally, when Excel is opened you get a blank workbook called Book1.
I have created a macro which sits in the XLStart directory and auto
runs whenever a workbook or excel itself is opened. Following this
macro being added, I no longer get a blank workbook automatically on
opening Excel, how do I change this back?
 
B

Bob Phillips

What does the macro do, is it completing successfully?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

RobH

What does the macro do, is it completing successfully?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)






- Show quoted text -

The macro runs fine, looks for a certain value in a certain cell. If
it finds it, it does lots of processing. If it doesn't find it, it
just ends. It does this using an If...End if statement.
 
R

RobH

You could start by disabling the macro to see if that solves the problem.

Mike





- Show quoted text -

Removing the macro does solve the problem, but I obviously need the
macro to be there.
 
N

NickHK

Well you know your code is the culprit. However, apart from the fact that it
contains an If..Then block, we have no idea of what you are doing.

NickHK
 
P

Peter T

I have created a macro which sits in the XLStart directory

If this is an xls, hidden perhaps, it'll open as Excel starts in lieu of the
default blank workbook.

Regards,
Peter T
 
R

RobH

Well you know your code is the culprit. However, apart from the fact that it
contains an If..Then block, we have no idea of what you are doing.

NickHK

"RobH" <[email protected]>
???????:[email protected]...





- Show quoted text -

I have the following in my spreadsheet

I have the following in a Class Module:

Public WithEvents app As Application
Private Sub app_WorkbookOpen(ByVal wb As Workbook)

If wb.Windows(1).Visible = True Then
Call check_cobt
End If

End Sub

I have the following in an Excel Object:

Private Sub Workbook_Open()

Set appclass.app = Application

End Sub

I also have a module with a macro called check_cobt. This starts and
finishes as follows:

Public appclass As New CoBTClass
Sub check_cobt()
'
startandend = ActiveCell.Address
If Left(Range("B1"), 14) = "ZZCOBTZZCOBTZZ" Then
'
Range("A1").Select
Selection.EntireRow.Insert
Selection.Font.Size = 24
Selection.Font.Bold = True
Selection.Font.ColorIndex = 3
ActiveCell = "Report generating, please wait..."
 
J

John

I have the following in my spreadsheet

I have the following in a Class Module:

Public WithEvents app As Application
Private Sub app_WorkbookOpen(ByVal wb As Workbook)

If wb.Windows(1).Visible = True Then
Call check_cobt
End If

End Sub

I have the following in an Excel Object:

Private Sub Workbook_Open()

Set appclass.app = Application

End Sub

I also have a module with a macro called check_cobt. This starts and
finishes as follows:

Public appclass As New CoBTClass
Sub check_cobt()
'
startandend = ActiveCell.Address
If Left(Range("B1"), 14) = "ZZCOBTZZCOBTZZ" Then
'
Range("A1").Select
Selection.EntireRow.Insert
Selection.Font.Size = 24
Selection.Font.Bold = True
Selection.Font.ColorIndex = 3
ActiveCell = "Report generating, please wait..."
.
.
.
.
.
End If
Range(startandend).Select
'
End Sub

The check_cobt macro does a whole load of screen formatting based on
the information in the workbook, and then prepares it for printing.- Hide quoted text -

- Show quoted text -

you could just have the macro create a new workbook...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top