ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro not running when it is supposed too (https://www.excelbanter.com/excel-programming/397371-macro-not-running-when-supposed-too.html)

[email protected]

Macro not running when it is supposed too
 
I have a problem in that I have a Command button that hides a form and
then calls an external (still same workbook) function, except it
doesn't run the external function.

When I step through the function it works fine. It doesn't work if I
step from the call to the function and when the function is
highlighted I tell it to run it doesn't work either.

The thing is that the programming works fine on my computer, it is
only when I go to show the user that it doesn't work properly.

I have checked and the Macro has the same references and the exact
same version of excel.

Any thoughts?

Thanks

Girkers


JNW

Macro not running when it is supposed too
 
Can you post the code?
--
JNW


" wrote:

I have a problem in that I have a Command button that hides a form and
then calls an external (still same workbook) function, except it
doesn't run the external function.

When I step through the function it works fine. It doesn't work if I
step from the call to the function and when the function is
highlighted I tell it to run it doesn't work either.

The thing is that the programming works fine on my computer, it is
only when I go to show the user that it doesn't work properly.

I have checked and the Macro has the same references and the exact
same version of excel.

Any thoughts?

Thanks

Girkers



Girkers

Macro not running when it is supposed too
 
On Sep 13, 10:02 am, JNW wrote:
Can you post the code?
--
JNW



" wrote:
I have a problem in that I have a Command button that hides a form and
then calls an external (still same workbook) function, except it
doesn't run the external function.


When I step through the function it works fine. It doesn't work if I
step from the call to the function and when the function is
highlighted I tell it to run it doesn't work either.


The thing is that the programming works fine on my computer, it is
only when I go to show the user that it doesn't work properly.


I have checked and the Macro has the same references and the exact
same version of excel.


Any thoughts?


Thanks


Girkers- Hide quoted text -


- Show quoted text -


Command button code:

Private Sub cmd_Finish_Click()

Me.Hide
Move_Data

End Sub

Other function:

Public Sub Move_Data()
On Error GoTo Err_Error_State

Application.ScreenUpdating = False
Dim wbkInstance
Dim strCurrentPath
Dim intCount As Integer
Dim booInserted As Boolean

booInserted = False

Worksheets("Sheet1").Range("All_Data").Copy
strCurrentPath = ActiveWorkbook.Path
Workbooks.Open strCurrentPath & "\QLDONSHOW.xls", , False, , , ,
True, , , True, , , False, True
intCount =
Workbooks("QLDONSHOW.xls").Worksheets("Sheet1").Ra nge("Count").Value +
1
Do While booInserted = False

With Workbooks("QLDONSHOW.xls").Worksheets("Sheet1")
.Range("Start").Offset(intCount, 0).Select
If IsEmpty(ActiveCell) Then
.Paste
booInserted = True
Else
intCount = intCount + 1
End If
.Range("Count").Value = intCount
End With

Loop
Workbooks("QLDONSHOW.xls").Close True

Initialise_Form

Exit_Sub:
Exit Sub

Err_Error_State:
Application.ScreenUpdating = True
Resume Exit_Sub

End Sub



All times are GMT +1. The time now is 12:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com