excel - Unwanted Print Setup -
so i'm experiencing weird behavior while trying open new workbook (checkwb). when new workbook opens opens "print setup" dialog box every single page in workbook. furthermore, after clicking "ok" ~200 times code runs fine, if close checkwb , try run code again unable open checkwb until close excel entirely , reopen, @ point print dialogs reappear. here's (incomplete) code:
sub check() application.screenupdating = false application.displayalerts = false dim homewb workbook dim checkwb workbook dim ws worksheet dim namestr string dim checkarray() double set homewb = workbooks("branchtable calc b31.3.xlsm") set checkwb = workbooks.open("z:\agrium\redwater\e130040cp ~ pipe spec update\m-mech\20-eng\calcs\final wt calcs specs\new bechtel agrium comments.xlsm") each ws in homewb.sheets if ws.name = "cover" or ws.name = "pipe dims" else: namestr = ws.name & " weld" checkarray() = getcheckvalues(checkwb, namestr) end if next checkwb.close application.screenupdating = true application.displayalerts = true end sub i've read weird errors can occur corrupted files code shouldn't able open file @ if corrupt understanding.
setting page view sheets in target workbook "normal" mode fixed problem. ricardo rodrigues tip!
Comments
Post a Comment