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

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -