|
-
Aug 5th, 2021, 03:15 PM
#1
Thread Starter
Junior Member
EXCEL Macros quit working: My Set EXCELWorkBook = Statement fails
Windows 7, MS Office 2007:
Recently the EXCEL Macros I've been using for years quit working. I defined the working Objects as Globals:
Global gobjEXCEL As Object
Global gobjEXCELWorkBook As Object
Global gobjEXCELWorksheet As Object
Then I use SET Statements to name the EXCEL Objects I want to use:
1) Set gobjEXCEL = CreateObject("Excel.Application")
2) Set gobjEXCELWorkBook = GetObject(pzExcelFileName)
3) Set gobjEXCELWorksheet = gobjEXCELWorkBook.Worksheets("Sheet1")
1 works, gobjEXCEL= Microsfoft Excel
2 fails, without setting ERR, subsequently 3 fails
This code has worked for a long time and only stopped working i n the last few days after a flurry of MS Updates.
Anybody know whats wrong with my Globals and/or Set Statements? I recently seemed to have a related problem ( Updates??? ) with VB6 and Access which got resolved with some Reference changes. But I haven't found a clue in the Object Browser and there aren't any Reference choices in EXCEL!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|